I want to map location of certain facilities on the African continent and I am able to do so using the code below. Now I want to color only specific countries (take Namibia as an example) to make another analysis more clear. Does anybode know a clean way of doing this? Thank you very much in advance.
Best, Bram
import pandas as pd
import geopandas as gpd
import matplotlib.pyplot as plt
world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))
data = pd.read_csv("Repair_yards_africa.csv")
base = world[world.continent == 'Africa'].plot(color='white', edgecolor='black')
data['Coordinates'] = list(zip(data.lon, data.lat))
data['Coordinates'] = data['Coordinates'].apply(Point)
geodata = gpd.GeoDataFrame(data, geometry='Coordinates')
geodata.plot(ax=base, color='red', markersize=11)
plt.ylabel('Lattitude')
plt.xlabel('Longitude')
This might be a "clean way of coloring only specific countries (take Namibia as an example)". Only relevant part of code is given.
The resulting plot:
Edit
Alternatively, the plot can be produced by this shorter version of code.