Dobrý den, jak prosím sloučit obrázky (i ze souboru) do jednoho a malovat přes ně? Děkuji
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import imageio
from bokeh.plotting import figure, output_file, show
import os
from matplotlib.colors import LinearSegmentedColormap
from scipy import ndimage
import matplotlib.image as mpimg
# Plot figure with size
fig, ax = plt.subplots()
i = 320
my_map = Basemap(projection='ortho', lat_0=0, lon_0=i, resolution='l', area_thresh=1000.0)
my_map.bluemarble()
my_map.etopo()
plt.savefig('Earth.png')
# Consolidation with the help of mpimg
fig, ax = plt.subplots(figsize=(10,5))
img = mpimg.imread('Earth.png')
imgplot = plt.imshow(img)
# Fuzzy annulus - applying a gaussian blur
rad1, rad2 = 70, 95
rad_max = 120
x = np.linspace(-rad_max, rad_max, 500)
y = np.linspace(-rad_max, rad_max, 500)
r = np.sqrt(x[:, np.newaxis] ** 2 + y[np.newaxis, :] ** 2)
img = np.array((r > rad1) & (r < rad2), dtype=float)
img = ndimage.gaussian_filter(img, sigma=20, mode='nearest')
cmap = LinearSegmentedColormap.from_list('', ['white', 'steelblue'])
plt.imshow(img, extent=[-rad_max, rad_max, -rad_max, rad_max], cmap=cmap)
plt.show()
os.remove("Earth.png")