在python matplotlib中绘制白色灰度图像
这应该是令人尴尬的简单,但我遗漏了一些东西。其目的是在matplotlib中创建和打印白色图像。下面的代码应该很接近,但它绘制了一个黑色图像。我错过了什么在python matplotlib中绘制白色灰度图像,python,matplotlib,Python,Matplotlib,这应该是令人尴尬的简单,但我遗漏了一些东西。其目的是在matplotlib中创建和打印白色图像。下面的代码应该很接近,但它绘制了一个黑色图像。我错过了什么 import numpy as np import matplotlib.pyplot as plt height = 100 white = np.ones((height, height), dtype=np.float) print white plt.imshow(white, cmap='gray') plt.show() 使用
import numpy as np
import matplotlib.pyplot as plt
height = 100
white = np.ones((height, height), dtype=np.float)
print white
plt.imshow(white, cmap='gray')
plt.show()
使用
您好,如果下面的帖子回答了您的问题,请接受它作为解决方案。。。谢谢
plt.imshow(white, cmap='gray',vmin=0,vmax=1)