DS9-style image stretching for matplotlib