(x, y, text, code)
| 59 | # Annotate the figure |
| 60 | |
| 61 | def annotate(x, y, text, code): |
| 62 | # Circle marker |
| 63 | c = Circle((x, y), radius=0.15, clip_on=False, zorder=10, linewidth=2.5, |
| 64 | edgecolor=royal_blue + [0.6], facecolor='none', |
| 65 | path_effects=[withStroke(linewidth=7, foreground='white')]) |
| 66 | ax.add_artist(c) |
| 67 | |
| 68 | # use path_effects as a background for the texts |
| 69 | # draw the path_effects and the colored text separately so that the |
| 70 | # path_effects cannot clip other texts |
| 71 | for path_effects in [[withStroke(linewidth=7, foreground='white')], []]: |
| 72 | color = 'white' if path_effects else royal_blue |
| 73 | ax.text(x, y-0.2, text, zorder=100, |
| 74 | ha='center', va='top', weight='bold', color=color, |
| 75 | style='italic', fontfamily='monospace', |
| 76 | path_effects=path_effects) |
| 77 | |
| 78 | color = 'white' if path_effects else 'black' |
| 79 | ax.text(x, y-0.33, code, zorder=100, |
| 80 | ha='center', va='top', weight='normal', color=color, |
| 81 | fontfamily='monospace', fontsize='medium', |
| 82 | path_effects=path_effects) |
| 83 | |
| 84 | |
| 85 | annotate(3.5, -0.13, "Minor tick label", "ax.xaxis.set_minor_formatter") |
no test coverage detected
searching dependent graphs…