
I am trying to access the canvas of a figure via JS but that does not seem to be possible (I am probably overlooking something).
Sofar I am using const canvas_arr = document.getElementsByTagName('canvas'); which returns all canvas. However with that I can’t really match a figure and its canvas, as the canvas has no ID.
Anyone got an idea how to get the canvas elements of a figure?

