Interpolate in one direction
matplotlib
Solution
This tutorial covers a range of interpolation available in numpy/scipy. If you want to just one direction, I would work on each row independently and then re-assemble the results. You might also be interested is simply smoothing your data (exmple, Python Smooth Time Series Data, Using strides for an efficient moving average filter).
def smooth_inter_fun(r):
#what ever process you want to use
new_data = np.vstack([smooth_inter_fun(r) for r in data])
Problem
I have sampled data and plot it with `imshow()`: I would like to interpolate just in horizontal axis so that I can easier distinguish samples and spot features. Is it possible to make interpolation just in one direction with MPL? Update: SciPy has whole package with various interpolation methods. I used simplest interp1d, as suggested by tcaswell: ``` def smooth_inter_fun(r): s = interpolate.interp1d(arange(len(r)), r) xnew = arange(0, len(r)-1, .1) return s(xnew) new_data = np.vstack([smooth_inter_fun(r) for r in data]) ``` Linear and cubic results: As expected :)