Python: 多角形地図, basemap, ploygon ver. 1

Polygonを使ったグラフです。中心都市、左下端、右上端の緯度と経度を指定します。

 

Creating Attractive and Informative Map Visualisations in Python with Basemap

 

 

 

import matplotlib.pyplot as plt
import matplotlib.cm
from mpl_toolkits.basemap import Basemap
from matplotlib.patches import Polygon
from matplotlib.collections import PatchCollection
from matplotlib.colors import Normalize

# map japan
fig, ax = plt.subplots(figsize=(10,20))
m = Basemap(resolution='c', # c, l, i, h, f or None
            projection='merc',
            lat_0=35.18, lon_0=136.90,
            llcrnrlon=120.2, llcrnrlat= 28.1, urcrnrlon=150., urcrnrlat=58.2)
m.drawmapboundary(fill_color='#46bcec')
m.fillcontinents(color='#f2f2f2',lake_color='#46bcec')
m.drawcoastlines()

#map nagoya
fig, ax = plt.subplots(figsize=(10,20))
m = Basemap(resolution='c', # c, l, i, h, f or None
            projection='merc',
            lat_0=35.18, lon_0=136.90,
            llcrnrlon=134.2, llcrnrlat= 33.1, urcrnrlon=138., urcrnrlat=38.2)
m.drawmapboundary(fill_color='#46bcec')
m.fillcontinents(color='#f2f2f2',lake_color='#46bcec')
m.drawcoastlines()

 

Please follow and like us:
error

About shibatau

I was born and grown up in Kyoto. I studied western philosophy at the University and specialized in analytic philosophy, especially Ludwig Wittgenstein at the postgraduate school. I'm interested in new technology, especially machine learning and have been learning R language for two years and began to learn Python last summer. Listening toParamore, Sia, Amazarashi and MIyuki Nakajima. Favorite movies I've recently seen: "FREEHELD". Favorite actors and actresses: Anthony Hopkins, Denzel Washington, Ellen Page, Meryl Streep, Mia Wasikowska and Robert DeNiro. Favorite books: Fyodor Mikhailovich Dostoyevsky, "The Karamazov Brothers", Shinran, "Lamentations of Divergences". Favorite phrase: Salvation by Faith. Twitter: @shibatau

2 Comments

  1. 私のブログにリンクをしてくれてありがとうございます。:)

    Basemapが相当便利なツールですね。

    • こちらこそありがとうございます。日本にお住まいなんですね。よろしくお願いいたします。

      Thank you for your comment in Japanese. I have learned a lot from your page.
      Now I’m trying to create other maps according to your scripts. Let me explain about your scripts and how to create maps in Japanese in my blog soon.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.