After applying #37, there is one more failure in the above test. It looks like the result is a little different:
opening figure
opening axes
draw line with 3 points
draw 3 markers
opening legend
draw text 'None' None
draw line with 2 points
draw text 'label' None
draw 2 markers
draw text 'dots' None
draw path with 4 vertices
closing legend
closing axes
closing figure
There's some extra text, and one less vertex in the last path.