I've managed to print my Rsquared values onto scatter subplots but for some reason it's shifted each value onto the wrong graph by one. I have 8 graphs and the last graph for some reason doesn't get an Rsquared value printed on it!
My code for this part is:
for j = 2:9 %change 9 to 8 when removing one KPI
y = T{:,j}; R = corrcoef(x,y); R_squared = R(2)^2; text(5, 5, ['R^2 =' num2str(R_squared)]);ax = subplot(2,4,(j-1));scatter(ax,x,y,'filled'); lsline(ax); ylim([0,max(y+10)]); xlim([0,8]); xlabel('League Score'); ylabel(T.Properties.VariableNames{(j)});end;
So obviously the text part is what prints the rsquared values to my graphs.
Thank you!!
Best Answer