matplotlib.artist.Artist.add_callback#

Artist.add_callback(func)[source]#

Add a callback function that will be called whenever one of theArtist's properties changes.

Parameters:
funccallable

The callback function. It must have the signature:

deffunc(artist:Artist)->Any

whereartist is the callingArtist. Return values may existbut are ignored.

Returns:
int

The observer id associated with the callback. This id can beused for removing the callback withremove_callback later.