MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _fill_between_x_or_y

Method _fill_between_x_or_y

lib/matplotlib/axes/_axes.py:6005–6108  ·  view source on GitHub ↗

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*.

(
            self, ind_dir, ind, dep1, dep2=0, *,
            where=None, interpolate=False, step=None, **kwargs)

Source from the content-addressed store, hash-verified

6003 return patches
6004
6005 def _fill_between_x_or_y(
6006 self, ind_dir, ind, dep1, dep2=0, *,
6007 where=None, interpolate=False, step=None, **kwargs):
6008 # Common implementation between fill_between (*ind_dir*="x") and
6009 # fill_betweenx (*ind_dir*="y"). *ind* is the independent variable,
6010 # *dep* the dependent variable. The docstring below is interpolated
6011 # to generate both methods' docstrings.
6012 """
6013 Fill the area between two {dir} curves.
6014
6015 The curves are defined by the points (*{ind}*, *{dep}1*) and (*{ind}*,
6016 *{dep}2*). This creates one or multiple polygons describing the filled
6017 area.
6018
6019 You may exclude some {dir} sections from filling using *where*.
6020
6021 By default, the edges connect the given points directly. Use *step*
6022 if the filling should be a step function, i.e. constant in between
6023 *{ind}*.
6024
6025 Parameters
6026 ----------
6027 {ind} : array-like
6028 The {ind} coordinates of the nodes defining the curves.
6029
6030 {dep}1 : array-like or float
6031 The {dep} coordinates of the nodes defining the first curve.
6032
6033 {dep}2 : array-like or float, default: 0
6034 The {dep} coordinates of the nodes defining the second curve.
6035
6036 where : array-like of bool, optional
6037 Define *where* to exclude some {dir} regions from being filled.
6038 The filled regions are defined by the coordinates ``{ind}[where]``.
6039 More precisely, fill between ``{ind}[i]`` and ``{ind}[i+1]`` if
6040 ``where[i] and where[i+1]``. Note that this definition implies
6041 that an isolated *True* value between two *False* values in *where*
6042 will not result in filling. Both sides of the *True* position
6043 remain unfilled due to the adjacent *False* values.
6044
6045 interpolate : bool, default: False
6046 This option is only relevant if *where* is used and the two curves
6047 are crossing each other.
6048
6049 Semantically, *where* is often used for *{dep}1* > *{dep}2* or
6050 similar. By default, the nodes of the polygon defining the filled
6051 region will only be placed at the positions in the *{ind}* array.
6052 Such a polygon cannot describe the above semantics close to the
6053 intersection. The {ind}-sections containing the intersection are
6054 simply clipped.
6055
6056 Setting *interpolate* to *True* will calculate the actual
6057 intersection point and extend the filled region up to this point.
6058
6059 step : {{'pre', 'post', 'mid'}}, optional
6060 Define *step* if the filling should be a step function,
6061 i.e. constant in between *{ind}*. The value determines where the
6062 step will occur:

Callers 2

fill_betweenMethod · 0.95
fill_betweenxMethod · 0.95

Calls 4

_f_dir_from_tMethod · 0.80
add_collectionMethod · 0.80
get_next_colorMethod · 0.45

Tested by

no test coverage detected