MCPcopy Create free account
hub / github.com/Derive-Risk/pyfair / _generate_rects

Method _generate_rects

pyfair/report/tree_graph.py:94–109  ·  view source on GitHub ↗

Generate rectangles, which cannot be done via apply

(self, ax)

Source from the content-addressed store, hash-verified

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"""

Callers 1

generate_imageMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected