Created
May 16, 2022 14:53
-
-
Save recuraki/cb9dae18bf031a5778b03be9c6d91fe5 to your computer and use it in GitHub Desktop.
硬度ランキング日本地図プロット
This file contains hidden or 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
# !!pip install japanmap | |
from japanmap import pref_names,pref_code,picture | |
%matplotlib inline | |
import matplotlib.pyplot as plt | |
from pylab import rcParams | |
rcParams['figure.figsize'] = 8,8 | |
# 硬度ランキング | |
rank = [ | |
"沖縄", "千葉", "埼玉", "熊本", "茨城", | |
"東京", "神奈川", "福岡", "愛媛", "群馬", | |
"山梨", "和歌山", "静岡", "大分", "栃木", | |
"奈良", "鹿児島", "兵庫", "徳島", "長野", | |
"香川", "岡山", "滋賀", "三重", "佐賀", | |
"大阪", "石川", "高知", "青森", "京都", | |
"岩手", "鳥取", "山口", "宮崎", "長崎", | |
"福井", "岐阜", "福島", "北海道", "新潟", | |
"富山", "秋田", "広島", "宮城", "島根", | |
"山形", "愛知"] | |
rankColor = dict() | |
for i in range(len(rank)): | |
grade = i // 5 # これで、順位を[0,1,2,3,4], [5,6,7,8,9]..ごとに0..9にプロットする | |
rankColor[rank[i]] = (25*grade,25*grade,255) | |
plt.imshow(picture(rankColor)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment