Forked from ueblog/gist:8b5518d25f46c9b63ee39b55b59cf45a
Created
May 15, 2020 16:55
-
-
Save kotoripiyopiyo/9b2a66c8f485e25d405a6b98f3ef66a2 to your computer and use it in GitHub Desktop.
list sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%matplotlib inline | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from PIL import Image | |
tokyo_tower = Image.open("tokyo_tower.png") | |
tower_color = np.array(tokyo_tower) | |
rgbcolor = ["red", "green", "blue"] | |
rgb_list = [0] * 3 | |
for i in range(3): | |
rgb0, rgb1 = np.histogram(tower_color[:, :, i].flatten(), bins=256) | |
rgb_list[i] = rgb0 | |
plt.figure(figsize=(10, 3)) | |
plt.subplot(1, 2, 1) | |
plt.imshow(tokyo_tower) | |
plt.subplot(1,2,2) | |
for i in range(3): | |
plt.plot(rgb_list[i], color=rgbcolor[i]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment