I want to plot a 2D scatter interpolation of some sensor data. I have the X, Y coordinates and the Z values. I am trying to build the same plot for several timeframes, lets say one for min 1 the other for min 2 and a third for min 3. The problem is the scale changes all the time as the Z max value always corresponds to the highest colour. I want that my Z max value to be always the same in colour in the interpolation colour. so the Max colour only appears in one of the images and does not correspond to my Z max value in each single image. Here is the code:
import numpy as np
import matplotlib.pyplot as plt
import scipy.interpolate
import pandas as pd
x = [444, 664, 0, 193, 444, 664, 0, 193, 444, 664,193]
y = [0, 0, 553, 553, 553, 553, 726, 726, 726, 726, 1107]
z = [-0.1, -0.25, 0.14, 0.45, 0.5, 0.7, -0.15, 0.27, 0.4, -0.2, 0.1]
# Set up a regular grid of interpolation points
xi, yi = np.linspace(min(x), max(x), 100), np.linspace(min(y), max(y), 100)
xi, yi = np.meshgrid(xi, yi)
# Interpolate
rbf = scipy.interpolate.Rbf(x, y, z, function='linear')
zi = rbf(xi, yi)
plt.figure(figsize=(6,10))
plt.imshow(zi, vmin=-0.25, vmax=1, origin='lower', extent=[min(x), max(x), min(y), max(y)])
plt.contourf(xi, yi, zi, 500, cmap='jet')
plt.scatter(x, y, c=z, cmap='jet')
plt.colorbar()
plt.clim(-0.25, 1)