Set a custom cell in a given position.
(self, position, cell)
| 288 | return cell |
| 289 | |
| 290 | def __setitem__(self, position, cell): |
| 291 | """ |
| 292 | Set a custom cell in a given position. |
| 293 | """ |
| 294 | if not isinstance(cell, CustomCell): |
| 295 | raise TypeError('Table only accepts CustomCell') |
| 296 | try: |
| 297 | row, col = position[0], position[1] |
| 298 | except Exception: |
| 299 | raise KeyError('Only tuples length 2 are accepted as coordinates') |
| 300 | cell.set_figure(self.figure) |
| 301 | cell.set_transform(self.get_transform()) |
| 302 | cell.set_clip_on(False) |
| 303 | self._cells[row, col] = cell |
| 304 | self.stale = True |
| 305 | |
| 306 | def __getitem__(self, position): |
| 307 | """ |
no test coverage detected