Are your depths a regular grid (i.e. a constant spacing)? If so, you can use imshow and set the range using the extent and aspect='auto' keywords. Otherwise, you have two options.
Instead, you can use pcolormesh and use shading='gouraud' . This will help with sharp color quantization, but not as good as interpolation.
The second choice is to interpolate the data into a new regular depth grid, so you can use imshow and various interpolation options. For example, to interpolate only along the depth direction, you can use scipy interpolate.interp1d :
from scipy.interpolate import interp1d fint = interp1d(depth, data.T, kind='cubic') newdata = fint(newdepth).T
Added .T , because the interpolation should be at the last index, and the depth is the first index of your data. You can replace kind with 'linear' if you want.
tiago source share