Draw main spine, head and tail. Parameters ---------- xmin : int The default position of the head of the spine's x-coordinate. xmax : int The default position of the tail of the spine's x-coordinate. Returns ------- None.
(xmin: int, xmax: int)
| 149 | |
| 150 | |
| 151 | def draw_spine(xmin: int, xmax: int): |
| 152 | """ |
| 153 | Draw main spine, head and tail. |
| 154 | |
| 155 | Parameters |
| 156 | ---------- |
| 157 | xmin : int |
| 158 | The default position of the head of the spine's |
| 159 | x-coordinate. |
| 160 | xmax : int |
| 161 | The default position of the tail of the spine's |
| 162 | x-coordinate. |
| 163 | |
| 164 | Returns |
| 165 | ------- |
| 166 | None. |
| 167 | |
| 168 | """ |
| 169 | # draw main spine |
| 170 | ax.plot([xmin - 0.1, xmax], [0, 0], color='tab:blue', linewidth=2) |
| 171 | # draw fish head |
| 172 | ax.text(xmax + 0.1, - 0.05, 'PROBLEM', fontsize=10, |
| 173 | weight='bold', color='white') |
| 174 | semicircle = Wedge((xmax, 0), 1, 270, 90, fc='tab:blue') |
| 175 | ax.add_patch(semicircle) |
| 176 | # draw fish tail |
| 177 | tail_pos = [[xmin - 0.8, 0.8], [xmin - 0.8, -0.8], [xmin, -0.01]] |
| 178 | triangle = Polygon(tail_pos, fc='tab:blue') |
| 179 | ax.add_patch(triangle) |
| 180 | |
| 181 | |
| 182 | # Input data |