6
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

東京都が千葉県の吐瀉物に見えた件

Posted at

ある企業のホームページを見ていて、色分けされた関東の地図が描かれていたんですが、それを見たらなんか

「東京都が千葉県の吐瀉物に見えた」

けど、そのホームページを晒すのはイケナイことのように思えたので Python で表現してみました。

PythonでExcelファイルを開く、そして日本地図に色を塗るを参考に色を塗ります。

!pip install japanmap
Collecting japanmap
[?25l  Downloading https://files.pythonhosted.org/packages/6c/49/2b29122d76a631984df2ebebead802f4e5752e33fe3478ccec2a2e4073da/japanmap-0.0.21.tar.gz (167kB)
[K     |████████████████████████████████| 174kB 2.8MB/s 
[?25hRequirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (from japanmap) (1.17.5)
Requirement already satisfied: opencv-python in /usr/local/lib/python3.6/dist-packages (from japanmap) (4.1.2.30)
Requirement already satisfied: Pillow in /usr/local/lib/python3.6/dist-packages (from japanmap) (6.2.2)
Building wheels for collected packages: japanmap
  Building wheel for japanmap (setup.py) ... [?25l[?25hdone
  Created wheel for japanmap: filename=japanmap-0.0.21-cp36-none-any.whl size=166793 sha256=2f5cc7c0ed321acf04cb8eb976225ec82e4087e9c11a72f490cfd942f128bf71
  Stored in directory: /root/.cache/pip/wheels/a0/7b/2b/331437760ae95113fa973e5ad7af111588ce9c7e76feb14f56
Successfully built japanmap
Installing collected packages: japanmap
Successfully installed japanmap-0.0.21
%matplotlib inline
import matplotlib.pyplot as plt
from pylab import rcParams
from japanmap import pref_names,pref_code,picture

rcParams['figure.figsize'] = 12, 12
plt.imshow(picture({'千葉':'red','東京':(255, 219, 88)}))
<matplotlib.image.AxesImage at 0x7f7020586748>

output_4_1.png

どうでしょうか。そんな気がしてきませんか?

6
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?