我创建了一个函数,可以将图像转换为灰度图像,也可以将图像转换为二进制图像。然而,返回值(应该是二进制图像)是紫色和黄色的。当我做'cmap = 'gray'‘时,它在函数中是正确的,但是,我不能在返回时做这件事。我怎么才能纠正它呢? 我当前的代码是: def greyscale_and_binary(file, file_name): this function graphs a histogram for the greyscale for the file inputed. It converts the image