MATLAB: How to reduce the space between Yticks

MATLABplotscatterytick

Hi, I am plotting a scatter plot with two groups on the Y axis. I want to reduce the distance between these groups in the plot as i only have two groups. Any help to solve this will be appreciated.

Best Answer

ylim([0 2])
yticks([0 2])
or
set(gca,'YTick',0:0.5:2)