I am having a bit of trouble with my output of my code to produce a 2d contour plot. I show the result below.
As may be seen, the y axis is greatly distorted, and yet my code seems to have nothing within it which should cause this. My code is shown below:
#vel_array, Rpl_array, and mass_loss_values are all some lists with the same length, but which I have not given here.
# Set up a regular grid of interpolation points
xi, yi = np.linspace(min(np.array(vel_array)), max(np.array(vel_array)), 100), np.linspace(min(np.array(Rpl_array)), max(np.array(Rpl_array)), 100)
xi, yi = np.meshgrid(xi, yi)
# Interpolate
rbf = Rbf(np.array(vel_array), np.array(Rpl_array), np.array(mass_loss_values), function='cubic')
zi = rbf(xi, yi)
mass_loss_values=np.array(mass_loss_values)
vel_array=np.array(vel_array)
Rpl_array=np.array(Rpl_array)
plt.imshow(zi, vmin=min(mass_loss_values), vmax=max(mass_loss_values), origin='lower',
extent=[min(vel_array), max(vel_array), min(Rpl_array), max(Rpl_array)])
plt.scatter(np.array(vel_array), np.array(Rpl_array), c=np.array(mass_loss_values))
plt.colorbar()
plt.show()
I would apprecaite assistance.