padding = 5
ax.annotate(s='image title', fontsize=12, xy=(0, 0), xytext=(padding - 1, -
    (padding - 1)), textcoords='offset pixels', bbox=dict(facecolor='white',
    alpha=1, pad=padding), va='top', ha='left')
Aligning a text box edge with an image corner