I have a scatter plots that looks like this :

Now I want to add least square fits of these points, so I do it using the lsline command in Matlab. And this is what I get
The problem with this plot is that all the data have been plotted for a common range of x values. I think Matlab picked up the maximum range of x values from the above scatter plot and then used it as a common value for all the lsline fits. I don't want this. I want independent lines for independent scatter plots and the xvalues should be independent for each line and not a common one.
Is there a way to do it? If not lsline maybe some other command?


lslineshould be doing. Could you add your code to show how you are usingscatterandlsline? - buzjwa