Skip to content

Instantly share code, notes, and snippets.

@psyaro
Created October 16, 2019 23:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save psyaro/6cfdb0f9f9b2885bcbc7b7b3a8a8e881 to your computer and use it in GitHub Desktop.
Save psyaro/6cfdb0f9f9b2885bcbc7b7b3a8a8e881 to your computer and use it in GitHub Desktop.
typhoon19root
import matplotlib.pyplot as plt
import tilemapbase
import pandas as pd
def main():
tilemapbase.start_logging()
tilemapbase.init(create=True)
t = tilemapbase.tiles.Tiles("http://mt0.google.com/vt/lyrs=m&x={x}&y={y}&z={zoom}", 'google_m')
extent = tilemapbase.Extent.from_lonlat(120, 170, 10, 50)
extent = extent.to_aspect(1.0)
extent = extent.with_centre_lonlat(139.7, 35.7).to_project_3857()
plt.rcParams['font.family'] = 'IPAexGothic'
fig, ax = plt.subplots(figsize=(10, 10), dpi=100)
tilemapbase.Plotter(extent, t, width=600).plot(ax)
df = pd.read_csv('downloads/taifu19.csv')
plt.plot(df.x, df.y)
ax.tick_params(labelbottom=False, bottom=False,
labelleft=False, left=False)
ax.set_xticklabels([])
fig.subplots_adjust(left=0, bottom=0,
right=1, top=1, wspace=0, hspace=0)
plt.savefig('img/out.png')
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment