Hi everyone,
I am facing issue while trying to color polygons based on their attributes.
I tried to do this through this method (https://flint.soest.hawaii.edu/t/how-to-color-polygons-of-a-geopandas-dataframe-in-pygmt/1138), but it still not solved.
I am trying to color the polygons based on the column ‘Year_only’ (in shapefile). In case anyone would like to see it: Upload Files | Free File Upload and Transfer Up To 10 GB (here is the shapefile that I used; it a small file).
Here are the codes I used:
fig = pygmt.Figure()
pygmt.makecpt(cmap="vik", series=[2017, 2021, 1], continuous=True, reverse=True)
fig.plot(data=footprint_each_DEMs,
cmap=True,
color="+z",
close=True,
aspatial="Z=Year",
pen="thinnest,red,-"
)
fig.colorbar(position="jMR+jMR+w8c+o0.1c/1c+e")
fig.show()
I followed the same method as in the example (https://flint.soest.hawaii.edu/t/how-to-color-polygons-of-a-geopandas-dataframe-in-pygmt/1138), but It seems not able to get what I expect.
What I got is attached below. The polygons are not colored based on the attributes, though the right colorbar appears.
But I expect something like below, with Years as colorbar.
It would be great if anyone can give me some hint to get so.
Thank you.
Arindan