You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the answer to my question on different websites. This looks like a simple issue, but I could not figure it out.
Question about geopandas
I have created the geopandas dataframe world by reading file from inherent datasets of geopandas. And then I plotted the continents as follows:
world = gpd.read_file(gpd.datasets.get_path("naturalearth_lowres"))
world.plot("continent", legend = True)
I'd like to provide my own colors to the continents and add them to the legends. I created a dictionary called color_dict and added it as a new column to world.
I get the colors for the continents that I set. However, I don't get the continents with colors in the legend. I am not able to figure out why this is the case. I am getting a UserWarning: Only specify one of 'column' or 'color'. Using 'color'.
warnings.warn(
Is there a way that I can get the color I defined for each continent in the map and the name of continent in the legend as well?
The text was updated successfully, but these errors were encountered:
I have searched the answer to my question on different websites. This looks like a simple issue, but I could not figure it out.
Question about geopandas
I have created the geopandas dataframe
world
by reading file from inherent datasets of geopandas. And then I plotted the continents as follows:I'd like to provide my own colors to the continents and add them to the legends. I created a dictionary called
color_dict
and added it as a new column toworld
.I get the colors for the continents that I set. However, I don't get the continents with colors in the legend. I am not able to figure out why this is the case. I am getting a UserWarning: Only specify one of 'column' or 'color'. Using 'color'.
warnings.warn(
Is there a way that I can get the color I defined for each continent in the map and the name of continent in the legend as well?
The text was updated successfully, but these errors were encountered: