Mexico Maps

Maps for https://mexico.werthmuller.org, but not yet used.


In [1]:
import numpy as np
import travelmaps as tm
from adashof import cm2in
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap

# Disable DecompressionBombWarning
from PIL import Image
Image.MAX_IMAGE_PIXELS = None

%matplotlib inline
from matplotlib import rcParams
# Adjust dpi, so figure on screen and savefig looks the same
dpi = 200
rcParams['figure.dpi'] = dpi
rcParams['savefig.dpi'] = dpi

Tulum


In [6]:
fig_x = plt.figure(figsize=(cm2in([11, 6])))

MDF = [19.433333, -99.133333] # Mexico City
TUL = [20.214722, -87.428889] # Tulum
CAN = [21.160556, -86.8475]   # Cancun

# Create basemap
m_x = Basemap(width=3500000, height=2300000, resolution='c',
              projection='tmerc', lat_0=24, lon_0=-102)
m_x.drawmapboundary(fill_color='#99ccff')

# Fill non-visited countries (fillcontinents does a bad job)
countries = ['USA', 'BLZ', 'GTM', 'HND', 'SLV', 'NIC', 'CUB']
tm.country(countries, m_x, fc='.8', ec='.7', lw=.5)

# Fill states
stateclrs = 32*['g']
stateclrs[22] = 'r'
tm.country('MEX', bmap=m_x, fc=stateclrs, ec='.2', lw=.5, adm=1)

# Add visited cities
tm.city(TUL, 'Tulum', m_x, offs=[1, -3], halign="right")
tm.city(MDF, 'Mexiko Stadt', m_x, offs=[.5, .5], halign="right")
tm.city(CAN, 'Cancun', m_x, offs=[1, 1], halign="right")

# Save-path
#fpath = '../mexico.werthmuller.org/content/images/tulum/'
#plt.savefig(fpath+'MapTulum.png', bbox_inches='tight')
    
plt.show()


Malinalco


In [7]:
fig_x = plt.figure(figsize=(cm2in([11, 6])))

MDF = [19.433333, -99.133333] # Mexico City
MAL = [18.95,     -99.5]      # Oaxaca

# Create basemap
m_x = Basemap(width=700000, height=500000, resolution='c',
              projection='tmerc', lat_0=20, lon_0=-99)
m_x.drawmapboundary(fill_color='#99ccff')

# Fill states
stateclrs = 32*['g']
stateclrs[14] = 'r'
stateclrs[8] = 'c'
tm.country('MEX', bmap=m_x, fc=stateclrs, ec='.2', lw=.5, adm=1)

# Add visited cities
tm.city(MAL, 'Malinalco', m_x, offs=[0, -0.3], halign="right")

# Save-path
#fpath = '../mexico.werthmuller.org/content/images/malinalco/'
#plt.savefig(fpath+'MapMalinalco.png', bbox_inches='tight')
    
plt.show()


Teotihuacán


In [8]:
fig_x = plt.figure(figsize=(cm2in([11, 6])))

MDF = [19.433333, -99.133333] # Mexico City
TEO = [19.6925,   -98.8438] # Teotihuacán

# Create basemap
m_x = Basemap(width=700000, height=500000, resolution='c',
              projection='tmerc', lat_0=20, lon_0=-99)
m_x.drawmapboundary(fill_color='#99ccff')

# Fill states
stateclrs = 32*['g']
stateclrs[14] = 'r'
stateclrs[8] = 'c'
tm.country('MEX', bmap=m_x, fc=stateclrs, ec='.2', lw=.5, adm=1)

# Add visited cities
tm.city(TEO, 'Teotihuacan', m_x, offs=[0, .7], halign="center")

# Save-path
#fpath = '../mexico.werthmuller.org/content/images/teotihuacan/'
#plt.savefig(fpath+'MapTeotihuacan.png', bbox_inches='tight')
    
plt.show()