'How do I invert the World Map?
I'm having an issue with using cartopy in Python to plot the longitude and latitude of datapoints onto a world map.
However, the resulting world map is inverted but the data points are correct.
Adding the link to the dataFrame here as it is too large to display here (clean_countryData1)
# Plotting world map
! pip install cartopy
import matplotlib.pyplot as plt
import seaborn as sb
import cartopy.crs as ccrs
import cartopy.crs as ccrs
import cartopy.feature as cf
fig = plt.figure(figsize = (40, 20))
ax = fig.add_subplot(1, 1, 1,
projection = ccrs.PlateCarree())
ax.add_feature(cf.LAND)
ax.add_feature(cf.OCEAN)
ax.add_feature(cf.COASTLINE)
ax.add_feature(cf.BORDERS, linestyle = ':')
ax.add_feature(cf.LAKES, alpha = 0.5)
ax.add_feature(cf.RIVERS)
ax.set_title("Aircraft Accidents Around The World",
fontsize = 40)
sb.scatterplot(x = "LONGITUDE", y = "LATITUDE",
data = clean_countryData,
hue = "INJURY_SEVERITY",
alpha = 0.8,
marker = 'o',
s = 100,
color = "red",
transform = ccrs.PlateCarree())
plt.show()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

