Experimenting with the colors in the World Map.

pull/70/head
Christian Jacobs 2018-03-31 16:01:36 +01:00
rodzic fd41340109
commit 9609b9c3d4
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -294,7 +294,7 @@ class WorldMap:
gl.xformatter = cartopy.mpl.gridliner.LONGITUDE_FORMATTER
gl.yformatter = cartopy.mpl.gridliner.LATITUDE_FORMATTER
ax.add_feature(cartopy.feature.LAND, facecolor="green")
ax.add_feature(cartopy.feature.OCEAN)
ax.add_feature(cartopy.feature.OCEAN, facecolor="cornflowerblue")
ax.add_feature(cartopy.feature.COASTLINE)
ax.add_feature(cartopy.feature.BORDERS, alpha=0.4)
@ -335,7 +335,7 @@ class WorldMap:
logging.debug("Plotting QTHs on the map...")
for p in self.points:
ax.plot(p.longitude, p.latitude, p.style, transform=cartopy.crs.PlateCarree())
ax.text(p.longitude+0.02*p.longitude, p.latitude+0.02*p.latitude, p.name, color="white", size="small", weight="bold")
ax.text(p.longitude+0.04*p.longitude, p.latitude+0.04*p.latitude, p.name, color="white", size="small")
# Draw Maidenhead grid squares and shade in the worked squares.
x = numpy.linspace(-180, 180, len(list(self.maidenhead.upper))+1)
@ -347,13 +347,13 @@ class WorldMap:
else:
z = numpy.zeros((len(self.maidenhead.upper), len(self.maidenhead.upper)), dtype=bool)
masked = numpy.ma.masked_array(z, z == 0)
ax.pcolormesh(x, y, masked, transform=cartopy.crs.PlateCarree(), cmap='Purples', vmin=0, vmax=1, edgecolors="k", linewidth=2, alpha=0.4)
ax.pcolormesh(x, y, masked, transform=cartopy.crs.PlateCarree(), cmap='Reds', vmin=0, vmax=1, edgecolors="k", linewidth=2, alpha=0.5)
# Grid square labels.
for i in range(len(self.maidenhead.upper)):
for j in range(len(self.maidenhead.upper)):
text = self.maidenhead.upper[i]+self.maidenhead.upper[j]
ax.text((x[i]+x[i+1])/2.0, (y[j]+y[j+1])/2.0, text, ha="center", va="center", size=8, color="w")
ax.text((x[i]+x[i+1])/2.0, (y[j]+y[j+1])/2.0, text, ha="center", va="center", size=8, color="w", alpha=0.6)
return True
else: