Generate rectangles, which cannot be done via apply
(self, ax)
| 92 | return ax |
| 93 | |
| 94 | def _generate_rects(self, ax): |
| 95 | """Generate rectangles, which cannot be done via apply""" |
| 96 | patches = [] |
| 97 | patch_colors = [] |
| 98 | for index, row in self._data.iterrows(): |
| 99 | rect = Rectangle( |
| 100 | (row['self_x'], row['self_y']), |
| 101 | 1000, |
| 102 | 500, |
| 103 | alpha=.3, |
| 104 | ) |
| 105 | patches.append(rect) |
| 106 | patch_colors.append(row['color']) |
| 107 | collection = PatchCollection(patches, facecolor=patch_colors, alpha=.3) |
| 108 | ax.add_collection(collection) |
| 109 | return ax |
| 110 | |
| 111 | def _generate_text(self, row, ax): |
| 112 | """Apply-able function to gnereate text in rectangles""" |