dhursh = csvread('../data/hursh.csv',1,0);
%dhursh = csvread('hursh.csv', 1, 0);
lmhursh2 = polyfit(dhursh([24,26:58], 1), dhursh([24,26:58], 2), 1);
plot(dhursh([24,26:58], 1), dhursh([24,26:58], 2), 'o', 'MarkerSize', 7, 'MarkerFaceColor', [0.8, 0.8, 0.8], 'Color', [0.8, 0.8, 0.8])
hold on;
plot(dhursh(48, 1), dhursh(48, 2), 'o', 'MarkerSize', 7, 'MarkerFaceColor', 'k', 'Color', 'k')
xmean = mean(dhursh([24,26:58], 1));
ymean = mean(dhursh([24,26:58], 2));
plot(dhursh(48, 1), lmhursh2(1, 1)*dhursh(48, 1)+lmhursh2(1, 2), 'dk', 'MarkerSize', 6, 'MarkerFaceColor', 'k')
plot(xmean, ymean, 'dk', 'MarkerSize', 6, 'MarkerFaceColor', 'k')
xlabel({'';'Diameter'}, 'FontSize', 22)
ylabel({'Velocity';''}, 'FontSize', 22)
regline = refline(lmhursh2(1, 1), lmhursh2(1, 2));
set(regline, 'Color', [0.8, 0.8, 0.8])
xline = line([dhursh(48, 1), dhursh(48, 1)], [15, dhursh(48, 2)], 'Color', 'k');
trueyline = line([5, dhursh(48, 1)], [dhursh(48, 2), dhursh(48, 2)], 'Color', 'k');
predyline = line([5, dhursh(48, 1)], [lmhursh2(1, 1)*dhursh(48, 1)+lmhursh2(1, 2), lmhursh2(1, 1)*dhursh(48, 1)+lmhursh2(1, 2)], 'Color', 'k');
xmeanline = line([xmean, xmean], [0, ymean], 'Color', 'k');
ymeanline = line([0, xmean], [ymean, ymean], 'Color', 'k');
set(xline, 'LineStyle', ':')
set(trueyline, 'LineStyle', '--')
set(predyline, 'LineStyle', '--')
set(xmeanline, 'LineStyle', ':')
set(ymeanline, 'LineStyle', '--')
text(5, dhursh(48, 2)+0.25, '\leftarrow', 'FontSize', 20)
text(5, lmhursh2(1, 1)*dhursh(48, 1)+lmhursh2(1, 2)+0.25, '\leftarrow', 'FontSize', 20)
text(5, ymean+0.25, '\leftarrow', 'FontSize', 20)
set(gca, 'XLim', [5, 15], 'Ylim', [28, 88])
set(gca, 'Box', 'off', 'FontSize', 22, 'XTick', [xmean, dhursh(48, 1)], 'YTick', [ymean, lmhursh2(1, 1)*dhursh(48, 1)+lmhursh2(1, 2), dhursh(48, 2)]);
format_ticks(gca, {'$\bar{x}$'; '$x_i$'}, {'$\bar{y}$'; '$\hat{y_i}$'; '$y_i$'});
set(gcf, 'Position', [200, 100, 1100, 900])