Mat Marquis here—I’m one of the editors on the picture
spec ( http://picture.responsiveimages.org ).
The short answer is “yes,” the long answer is “definitely.” Semantically correct (figure
can contain images, charts, tables, code snippets, and so on), and 100% valid.