Callback with figure as one of the inputs and the output

Hi, I´m doing something similar, I used sharing data between callbacks.

see Multiple callbacks sharing a variable

Hope it helps