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.
| 33 | "linewidth": ["lw"], |
| 34 | }) |
| 35 | class Patch(artist.Artist): |
| 36 | """ |
| 37 | A patch is a 2D artist with a face color and an edge color. |
| 38 | |
| 39 | If any of *edgecolor*, *facecolor*, *linewidth*, or *antialiased* |
| 40 | are *None*, they default to their rc params setting. |
| 41 | """ |
| 42 | zorder = 1 |
| 43 | |
| 44 | # Whether to draw an edge by default. Set on a |
| 45 | # subclass-by-subclass basis. |
| 46 | _edge_default = False |
| 47 | |
| 48 | def __init__(self, *, |
| 49 | edgecolor=None, |
| 50 | facecolor=None, |
| 51 | color=None, |
| 52 | linewidth=None, |
| 53 | linestyle=None, |
| 54 | antialiased=None, |
| 55 | hatch=None, |
| 56 | fill=True, |
| 57 | capstyle=None, |
| 58 | joinstyle=None, |
| 59 | hatchcolor=None, |
| 60 | edgegapcolor=None, |
| 61 | **kwargs): |
| 62 | """ |
| 63 | The following kwarg properties are supported |
| 64 | |
| 65 | %(Patch:kwdoc)s |
| 66 | """ |
| 67 | super().__init__() |
| 68 | |
| 69 | if linestyle is None: |
| 70 | linestyle = "solid" |
| 71 | if capstyle is None: |
| 72 | capstyle = CapStyle.butt |
| 73 | if joinstyle is None: |
| 74 | joinstyle = JoinStyle.miter |
| 75 | |
| 76 | self._hatch_linewidth = mpl.rcParams['hatch.linewidth'] |
| 77 | self._fill = bool(fill) # needed for set_facecolor call |
| 78 | if color is not None: |
| 79 | if edgecolor is not None or facecolor is not None: |
| 80 | _api.warn_external( |
| 81 | "Setting the 'color' property will override " |
| 82 | "the edgecolor or facecolor properties.") |
| 83 | self.set_color(color) |
| 84 | else: |
| 85 | self.set_edgecolor(edgecolor) |
| 86 | self.set_hatchcolor(hatchcolor) |
| 87 | self.set_facecolor(facecolor) |
| 88 | |
| 89 | self._linewidth = 0 |
| 90 | self._unscaled_dash_pattern = (0, None) # offset, dash |
| 91 | self._dash_pattern = (0, None) # offset, dash (scaled by linewidth) |
| 92 | self._gapcolor = None |
no outgoing calls
searching dependent graphs…