Is there an automatic way to add pure labels to the subplots? To be specific, I used
ax1 = fig.add_subplot(121)
ax2 = fig.add_subplot(122)
and I would like to add 'A' and 'B' to the upper right in the subplots to distinguish them, and right now I am using a dummy way something like
ax1.annotate('A', xy=(2, 1), xytext=(1, 22))
ax2.annotate('B', xy=(2, 1), xytext=(1, 22))
I tried using
ax1.legend()
and that also gives me "small images" of lines or dots before the letter and I do not need that image.
You can skip writing a helper function and just call:
ax1 = fig.add_subplot(121)
ax2 = fig.add_subplot(122)
ax1.annotate("A", xy=(0.9, 0.9), xycoords="axes fraction")
ax2.annotate("B", xy=(0.9, 0.9), xycoords="axes fraction")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With