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
(self, *args, data=None, **kwargs)
| 5951 | # Uses a custom implementation of data-kwarg handling in |
| 5952 | # _process_plot_var_args. |
| 5953 | def fill(self, *args, data=None, **kwargs): |
| 5954 | """ |
| 5955 | Plot filled polygons. |
| 5956 | |
| 5957 | Parameters |
| 5958 | ---------- |
| 5959 | *args : sequence of x, y, [color] |
| 5960 | Each polygon is defined by the lists of *x* and *y* positions of |
| 5961 | its nodes, optionally followed by a *color* specifier. See |
| 5962 | :mod:`matplotlib.colors` for supported color specifiers. The |
| 5963 | standard color cycle is used for polygons without a color |
| 5964 | specifier. |
| 5965 | |
| 5966 | You can plot multiple polygons by providing multiple *x*, *y*, |
| 5967 | *[color]* groups. |
| 5968 | |
| 5969 | For example, each of the following is legal:: |
| 5970 | |
| 5971 | ax.fill(x, y) # a polygon with default color |
| 5972 | ax.fill(x, y, "b") # a blue polygon |
| 5973 | ax.fill(x, y, x2, y2) # two polygons |
| 5974 | ax.fill(x, y, "b", x2, y2, "r") # a blue and a red polygon |
| 5975 | |
| 5976 | data : indexable object, optional |
| 5977 | An object with labelled data. If given, provide the label names to |
| 5978 | plot in *x* and *y*, e.g.:: |
| 5979 | |
| 5980 | ax.fill("time", "signal", |
| 5981 | data={"time": [0, 1, 2], "signal": [0, 1, 0]}) |
| 5982 | |
| 5983 | Returns |
| 5984 | ------- |
| 5985 | list of `~matplotlib.patches.Polygon` |
| 5986 | |
| 5987 | Other Parameters |
| 5988 | ---------------- |
| 5989 | **kwargs : `~matplotlib.patches.Polygon` properties |
| 5990 | |
| 5991 | Notes |
| 5992 | ----- |
| 5993 | Use :meth:`fill_between` if you would like to fill the region between |
| 5994 | two curves. |
| 5995 | """ |
| 5996 | # For compatibility(!), get aliases from Line2D rather than Patch. |
| 5997 | kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D) |
| 5998 | # _get_patches_for_fill returns a generator, convert it to a list. |
| 5999 | patches = [*self._get_patches_for_fill(self, *args, data=data, **kwargs)] |
| 6000 | for poly in patches: |
| 6001 | self.add_patch(poly) |
| 6002 | self._request_autoscale_view() |
| 6003 | return patches |
| 6004 | |
| 6005 | def _fill_between_x_or_y( |
| 6006 | self, ind_dir, ind, dep1, dep2=0, *, |