I have a shapefile in polygon type. In table of this shapefile there is a column with NAME
name. This column characters are in Farsi
font, non-English. I want to read this file with Geopandas
in jupyter
and then display name of each polygon label based on the NAME
column. I use the below code. It can display the map plot but the labels show as ????
character. Is there any idea to solve it?
import geopandas as gpd
import matplotlib.pyplot as plt
cities = gpd.read_file(r'/Maps/my_polygon.shp')
fig, ax = plt.subplots(figsize = (10,5))
cities.plot(color='black', edgecolor='k',linewidth = 1,ax=ax)
cities.geometry.boundary.plot(color=None, edgecolor='k',linewidth = 1,ax=ax)
# Labeling name of cities with field of 'NAME'
cities.apply(lambda x: ax.annotate(x.NAME, xy=x.geometry.centroid.coords[0], ha='center'),axis=1);