Text fields are artists. This way you can do many things with them if you keep a link to them . Therefore, in any graphic code, instead of
fig.text(0, 0, 'My text')
You can do
textvar = fig.text(0, 0, 'My text')
If you have lost links, all text objects can be found in the texts attribute:
fig.texts
In version 1.3.1, executing textvar.remove() throws a NotImplementedError (obviously fixed in 1.4). However, you can get around this to some extent by setting the visibility to False.
for txt in fig.texts: txt.set_visible(False)
will cause all text fields to disappear.
Ajean source share