graph_draw(): Improve flipping of y-direction when mplfig is being used

This fixes issue #261
8 jobs for master