As an addendum to Yannick Copin's answer which reads
The matplotlib C++ resampling code is interfaced in the matplotlib.image.resample function, which you can import and call on your own.
Here is a visual demo of interpolation using the private function matplotlib.image._resample
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.image import _resample
from matplotlib.transforms import Affine2D
np.random.seed(19680801)
grid = np.random.rand(4, 4)
scale_factor = 10
out_dimensions = (grid.shape[0]*scale_factor, grid.shape[1]*scale_factor)
fig, axs = plt.subplots(nrows=3)
transform = Affine2D().scale(scale_factor, scale_factor)
# Have to get an image to be able to resample
# Resample takes an _ImageBase or subclass, which require an Axes
img = axs[0].imshow(grid, interpolation='spline36', cmap='viridis')
interpolated = _resample(img, grid, out_dimensions, transform=transform)
axs[0].imshow(grid, cmap='viridis')
axs[1].imshow(grid, interpolation='spline36', cmap='viridis')
axs[2].imshow(interpolated, cmap='viridis')
