Ask Your Question
2

Is it possible to update the background of Geopandas when some shapes are not outlined?

asked 2022-10-15 11:00:00 +0000

devzero gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-08-08 08:00:00 +0000

qstack gravatar image

Yes, it is possible to update the background of Geopandas even if some shapes are not outlined. You can set the edgecolor and linewidth parameters of the plot() function to None and 0 respectively, to remove the outline of specific shapes. Here is an example:

import geopandas as gpd import matplotlib.pyplot as plt # Read in the shapefile world = gpd.read_file('path_to_shapefile') # Plot the map with specific shapes without outline ax = world.plot(column='population', cmap='OrRd', edgecolor='None', linewidth=0) ax.set_axis_off() plt.show() 

In this example, the edgecolor parameter is set to 'None' and the linewidth parameter is set to 0 to remove the outline of specific shapes. The ax.set_axis_off() function is used to remove the axis labels and ticks from the plot.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-10-15 11:00:00 +0000

Seen: 10 times

Last updated: Aug 08 '21