I would like to combine two images in a single GUI, but I want the combining to happen after I click a button. I'm using a grid structure to format the GUI, and employing Tkinter. The image is imported and placed using:
label2 = ttk.Label(tab2)
image2 = PhotoImage(file="worldna.gif")
label2['image'] = image2
label2.grid(column=0, row=0, columnspan=4)
Some database processing is done, and when I press a button, I get a contour plot. The contour is built using 3 vectors -- lat, lon, and data:
x = avglon; y = avglat; z = avgmeas
# Set up a regular grid of interpolation points
xi, yi = np.linspace(x.min(), x.max(), 150), np.linspace(y.min(), y.max(), 150)
xi, yi = np.meshgrid(xi, yi)
# Interpolate
rbf = scipy.interpolate.Rbf(x, y, z, function='cubic')
zi = rbf(xi, yi)
plt.imshow(zi, vmin=z.min(), vmax=z.max(), origin='lower',
extent=[x.min (), x.max(), y.min(), y.max()])
plt.set_adjustable('box-forced') # Eliminate white space around image
plt.scatter(x, y, c=z)
plt.show()
I would like to apply a 60% transparency to the interpolated scatter plot, and overlay it onto "worldna.gif". Any suggestions would be appreciated!