Open PrashantSaikia opened 6 years ago
most likely, the issue is that some of those polygons are closed and some of them are not. If they aren't closed, then they won't do a face color correctly.
I would also suggest using geopandas for this, or at the very least, use descarte for polygon making, as it will do it more correctly than what you have here. But, really, geopandas is probably exactly what you want to use.
I second the recommendation for geopandas
The code below is supposed to colour all the states of Vietnam:
But this produces the map below, where some of the states are not coloured even though they are present in the state names and in the subdivisions:
In fact, if I try to colour a state whose name is not present in the lists, it throws an error:
So, clearly the states that are not colored are present in the list, as I'm not getting any error. So, what's going on?
EDIT: It just struck me that almost all the states that aren’t coloured share at least some part of their border with sea/ocean in the real world. The 6 exceptions are highlighted in red below:
Now that’s very interesting! Could it have anything to do with the issue? If yes, what? And why? And why do those 6 exceptions exist?
EDIT 2: I have also found similar results when plotting the map of Philippines: