サンプルコード(参考URLまるまる利用)
# -*- coding:utf-8 -*- import matplotlib.pyplot as plt import PIL import numpy as np img_rgb = np.array([ [[255,0,0],[0,255,0],[0,0,255]], [[255,255,0],[0,255,255],[255,0,255]], [[0,0,0],[127,127,127],[255,255,255]], ], dtype = np.uint8) #画像の表示 #plt.imshow(img_rgb, cmap = 'gray', vmin = 0, vmax = 255, interpolation = 'none') plt.imshow(img_rgb, interpolation = 'none') plt.show()
アウトプット