Hey all, I wanted to have a 45-degree line on my plot in order to have a background for comparing with the trend line of forecasted. I used this code in order to make this 45 degree line:
class1 = scatter(X,Y,12,'k','filled');plot(1:max(X),'k'); %45 degree line (black)
plot(1:max(X),pp(1)*(1:max(X))+pp(2)); %trend line
In some of my data, everything is okay but in others, I achieve this figure:
I don't know why this happens. I want to have a black line in 45 degrees and trend line corresponding to it just like this picture below:
(Black is the 45-degree line and red is trend line)
Could anyone help me?
Thanks
Best Answer