2

I am trying to interpolate some 2D data and imshow seems to offer a lot of algorithms that do the job just fine, as I can observe in the plotted pic. However I can't seem to find a way to extract the interpolated data.

img = plt.imshow(data, interpolation='bicubic', cmap = cmap)

Alternatively, any other way I can use the same variety of algorithms without passing through imshow? Scipy interp2d has less choice and poorer results.

gionno
  • 31
  • 1
  • 2
  • 1
    [scipy.interpolate.griddata](https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.griddata.html) interpolates the 2D data onto a new grid. Also, `open cv` has functions to resample images using some filters see e.g. [Lanczos Interpolation in Python with 2D images](https://stackoverflow.com/questions/60416856/lanczos-interpolation-in-python-with-2d-images) – JohanC Dec 01 '20 at 10:17
  • I tested griddata. Unfortunately its altorithm introduces some artifacts that I do not observe when I use imshow. – gionno Dec 01 '20 at 10:22
  • You might edit your post and create such an example with toy data. Then, other StackOverflow users can suggest possible solutions or alternatives. – JohanC Dec 01 '20 at 12:47

0 Answers0