[ACCEPTED]-MatplotLib get all annotation by axes-tkinter-canvas
Accepted answer
You could loop over all the ax
children and 2 check if the child is of type matplotlib.text.Annotation
:
for child in ax.get_children():
if isinstance(child, matplotlib.text.Annotation):
print("bingo") # and do something
Or, if you 1 want a list:
annotations = [child for child in ax.get_children() if isinstance(child, matplotlib.text.Annotation)]
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.