Skip to content
Snippets Groups Projects
Commit 7465e005 authored by Timo Stomberg's avatar Timo Stomberg
Browse files

cartopy instead of basemaps

parent 23bb8179
No related branches found
No related tags found
No related merge requests found
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
import cartopy
import random
from settings import *
......@@ -35,18 +35,19 @@ class MapPlot:
self.markers = []
def plot(self, annotate=False):
tmap = Basemap(projection='cyl', resolution='l')
tmap.drawcoastlines()
tmap.fillcontinents()
tmap.drawcountries()
ax = plt.axes(projection=cartopy.crs.PlateCarree())
ax.add_feature(cartopy.feature.COASTLINE)
ax.add_feature(cartopy.feature.BORDERS, linestyle=':')
ax.add_feature(cartopy.feature.LAND)
ax.add_feature(cartopy.feature.OCEAN)
for i in range(len(self.data_plot)):
lons = self.data_plot[i]['lon'].to_list()
lats = self.data_plot[i]['lat'].to_list()
x, y = tmap(lons, lats)
x, y = lons, lats
tmap.scatter(x, y,
ax.scatter(x, y,
s=50,
color=self.colors[i],
marker=self.markers[i],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment