For a little design project, I want to use some geo data from OpenStreetMaps.
Let’s use the data from the little german coast village of Greetsiel for illustration of the issue.
I use the following code snippet:
import osmnx as ox
import matplotlib.pyplot as plt
place_name = "Greetsiel, Germany"
# List key-value pairs for tags
tags_buildings = {'building': True}
plt.rcParams["figure.dpi"] = 100
buildings = ox.features_from_place(place_name, tags_buildings)
buildings.plot(figsize=(120,180), markersize=0.01, linewidth=0.01)
plt.savefig(r'C:UsersLepakkDesktopbuildings.png', dpi=100)
The figure that is opened in Spyder looks like this:
Where the village is in the lower right corner, let’s focus on a uniquely shaped building in the center of the village.
If i open the saved image and zoom into the respective position, it looks like this:
Now I was thinking, the bad resolution might be due to 100 dpi being just not enough. Let’s change this value to
plt.rcParams["figure.dpi"] = 1000
buildings = ox.features_from_place(place_name, tags_buildings)
buildings.plot(figsize=(120,180), markersize=0.01, linewidth=0.01)
plt.savefig(r'C:UsersLepakkDesktopbuildings.png', dpi=1000)
The resolution should be ten times more now. However, the figure looks unchanged:
So, how can I change the resolution of the saved image file?
Thank you in advance!