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`.
| 37 | |
| 38 | |
| 39 | class Cell(Rectangle): |
| 40 | """ |
| 41 | A cell is a `.Rectangle` with some associated `.Text`. |
| 42 | |
| 43 | As a user, you'll most likely not creates cells yourself. Instead, you |
| 44 | should use either the `~matplotlib.table.table` factory function or |
| 45 | `.Table.add_cell`. |
| 46 | """ |
| 47 | |
| 48 | PAD = 0.1 |
| 49 | """Padding between text and rectangle.""" |
| 50 | |
| 51 | _edges = 'BRTL' |
| 52 | _edge_aliases = {'open': '', |
| 53 | 'closed': _edges, # default |
| 54 | 'horizontal': 'BT', |
| 55 | 'vertical': 'RL' |
| 56 | } |
| 57 | |
| 58 | def __init__(self, xy, width, height, *, |
| 59 | edgecolor='k', facecolor='w', |
| 60 | fill=True, |
| 61 | text='', |
| 62 | loc='right', |
| 63 | fontproperties=None, |
| 64 | visible_edges='closed', |
| 65 | ): |
| 66 | """ |
| 67 | Parameters |
| 68 | ---------- |
| 69 | xy : 2-tuple |
| 70 | The position of the bottom left corner of the cell. |
| 71 | width : float |
| 72 | The cell width. |
| 73 | height : float |
| 74 | The cell height. |
| 75 | edgecolor : :mpltype:`color`, default: 'k' |
| 76 | The color of the cell border. |
| 77 | facecolor : :mpltype:`color`, default: 'w' |
| 78 | The cell facecolor. |
| 79 | fill : bool, default: True |
| 80 | Whether the cell background is filled. |
| 81 | text : str, optional |
| 82 | The cell text. |
| 83 | loc : {'right', 'center', 'left'} |
| 84 | The alignment of the text within the cell. |
| 85 | fontproperties : dict, optional |
| 86 | A dict defining the font properties of the text. Supported keys and |
| 87 | values are the keyword arguments accepted by `.FontProperties`. |
| 88 | visible_edges : {'closed', 'open', 'horizontal', 'vertical'} or \ |
| 89 | substring of 'BRTL' |
| 90 | The cell edges to be drawn with a line: a substring of 'BRTL' |
| 91 | (bottom, right, top, left), or one of 'open' (no edges drawn), |
| 92 | 'closed' (all edges drawn), 'horizontal' (bottom and top), |
| 93 | 'vertical' (right and left). |
| 94 | """ |
| 95 | |
| 96 | # Call base |
no outgoing calls
no test coverage detected
searching dependent graphs…