Home > front end >  Why does a frame around an image leave a corner incomplete?
Why does a frame around an image leave a corner incomplete?

Time:12-17

In the minimal example below, I'm trying to put a border around an image. But the bottom left corner remains blank. What does one need to do to fill it?

import matplotlib.pyplot as plt
import cartopy
import cartopy.crs as ccrs

plt.figure(figsize=(152, 90), dpi=10)
ax = plt.axes(projection=ccrs.PlateCarree(145))
land = cartopy.feature.NaturalEarthFeature('physical', 'land', scale='50m')
ocean = cartopy.feature.NaturalEarthFeature('physical', 'ocean', scale='50m')
ax.add_feature(land, facecolor='gray')
ax.add_feature(ocean, facecolor='black')
ax.patch.set_edgecolor('red')
ax.patch.set_linewidth('1000')  # exaggerated width for example
plt.savefig('islands.png', pad_inches=10)
plt.show()

Output:

Example image:

CodePudding user response:

The default enter image description here

  • Related