Mapping block names contained in a .dbf file to base map

Hello,
I am trying to generate a base map that, visualize the block boundaries on it, and map the block names to their respective block (please see attached image). I have 2 dataset to achieve that, blocks.shp and blocks.dbf.
Here is a snippet of my code:

import pygmt

fig = pygmt.Figure()
xmin = -92
xmax = -91.3
ymin = 28
ymax = 28.5

region = [xmin, xmax, ymin, ymax]  
projection = f"M{(xmin+xmax)/2}/{(ymin+ymax)/2}/10c"

fig.basemap(region=region, projection=projection, frame=True)

# protraction boundaries
fig.plot(
    data='/content/protrac.shp',
    region=region,
    projection=projection,
    pen='black'
)

# block boundaries
fig.plot(
    data='/content/blocks.shp',  # Replace 'block_shapefile.shp' with the actual filename and path
    region=region,
    projection=projection,
)

#Proposed code to map the block names but I am sure this is wrong
fig.plot(
    data='/content/blocks.dbf',  # Replace 'block_shapefile.shp' with the actual filename and path
    region=region,
    projection=projection,
)


fig.plot(
    x=-91.4616,
    y=28.3668,
    style='a0.1i',
    color='red',
    pen='black',
    label='BH_Well',
)

fig.legend(position="JTR+jTR+o0.2c/0.2c", box=True)

with pygmt.config(FONT_TITLE=8):
    fig.basemap(rose="jTL+w1.3c+lO,E,S,N+o-0.1c/3c")

fig.savefig("gulf_of_mexico_bathymetry.png")
fig.show() 

Thank you

I am not sure, but I don’t think GMT reads the various fields from the database that can be associated with a Shapefile. It would be easy to do this in QGIS that is designed to access all the GIS information in Shapefiles and other data formats.

I came across the section of the GMT documentation that explains how they have added support for reading other attributes that are non-spatial or “aspatial” data that is part of a Shapefile. This can likely be used to extract the block names from the Shapefile. One important thing to remember about Shapefiles is that the Shapefile dataset is actually the whole collection of files together. You should always keep the Shapefile set of files together, and you normally refer to the set by the name of the “.shp” file and the reading programs extract the other information from the other parts of the set. Check out the “-a” option: