var1 = mean_normed_moving_target_nuclei_overlap;
var2 = mean_normed_target_moving_nuclei_overlap;
var3 = mean_normed_moving_target_cb_overlap;
var4 = mean_normed_target_moving_cb_overlap;
var5 = mean_normed_moving_target_neurites_overlap;
var6 = mean_normed_target_moving_neurites_overlap;

error1 = std_normed_moving_target_nuclei_overlap/sqrt(30);
error2 = std_normed_target_moving_nuclei_overlap/sqrt(30);
error3 = std_normed_moving_target_cb_overlap/sqrt(30);
error4 = std_normed_target_moving_cb_overlap/sqrt(30);
error5 = std_normed_moving_target_neurites_overlap/sqrt(30);
error6 = std_normed_target_moving_neurites_overlap/sqrt(30);

% figure; bar([1 2 3],[1 3 5])

x_points = [1 2 3 6 7 8 11 12 13 16 17 18]

new_variables_ordered1 = [var1(1) var3(1) var5(1) var1(2) var3(2) var5(2) var1(3) var3(3) var5(3) var1(4) var3(4) var5(4)];
new_variables_ordered2 = [var2(1) var4(1) var6(1) var2(2) var4(2) var6(2) var2(3) var4(3) var6(3) var2(4) var4(4) var6(4)];

% figure; bar(x_points,new_variables_ordered1)
% figure; bar(x_points,new_variables_ordered2)

x_points_new_ordering1 = [1 6 11 16];
x_points_new_ordering2 = [2 7 12 17];
x_points_new_ordering3 = [3 8 13 18];


% moving to target overlaps

figure; barh1 = bar(x_points_new_ordering1(:),var1)
hold on;
errorbarh1 = errorbar(x_points_new_ordering1(:),var1,error1,'.b');
barh2 = bar(x_points_new_ordering2(:),var3)
errorbarh2 = errorbar(x_points_new_ordering2(:),var3,error3,'.b');
barh3 = bar(x_points_new_ordering3(:),var5);
errorbarh3 = errorbar(x_points_new_ordering3(:),var5,error5,'.b');



barh1.FaceColor = [0 .5 .5];
barh1.BarWidth = .2;

barh2.FaceColor = [1 0 0];
barh2.BarWidth = .2;

barh3.FaceColor = [0 0 0];
barh3.BarWidth = .2;


axis([0 20 0 1])

these_axes = gca;

these_axes.XTick = [1 7 13 ];
these_axes.XTickLabel = {'mov nuc', 'mov cb', 'mov neur'}


% target to moving overlaps



figure; hold on;
barh1 = bar(x_points_new_ordering1(:),var2)
errorbarh1 = errorbar(x_points_new_ordering1(:),var2,error2,'.b');

barh2 = bar(x_points_new_ordering2(:),var4)
errorbarh2 = errorbar(x_points_new_ordering2(:),var4,error4,'.b');

hold on;
barh3 = bar(x_points_new_ordering3(:),var6);
errorbarh3 = errorbar(x_points_new_ordering3(:),var6,error6,'.b');


barh1.FaceColor = [0 .5 .5];
barh1.BarWidth = .2;

barh2.FaceColor = [1 0 0];
barh2.BarWidth = .2;

barh3.FaceColor = [0 0 0];
barh3.BarWidth = .2;


axis([0 20 0 1])

these_axes = gca;

these_axes.XTick = [1 7 13 ];
these_axes.XTickLabel = {'targ nuc', 'targ cb', 'targ neur'}



% other_ordering1 = [var1(1:4)];
% other_ordering2 = [var3(1:4)];
% other_ordering3 = [var5(1:4)];
% other_x_points = [1 2 3 4 ; 7 8 9 10;  13 14 15 16];
% 
% 
% figure; barh1 = bar(other_x_points(1,:),[other_ordering1])
% hold on;
% barh2 = bar(other_x_points(2,:),[other_ordering2])
% hold on;
% barh3 = bar(other_x_points(3,:),[other_ordering3]);
% 
% 
% barh1.FaceColor = [0 .5 .5];
% barh2.FaceColor = [1 0 0];
% barh3.FaceColor = [0 0 0];
% 
% 
% 
% x_points_new_ordering1 = [1 4 7 10];
% x_points_new_ordering2 = [2 5 8 11];
% x_points_new_ordering3 = [3 6 9 12];
% 
% 
% axis([0 17 0 .8])
% 
% these_axes = gca;
% 
% these_axes.XTick = [1 7 13 ];
% these_axes.XTickLabel = {'mov nuc', 'mov cb', 'mov neur'}

% 
% other_ordering1 = [var2(1:4)];
% other_ordering2 = [var4(1:4)];
% other_ordering3 = [var6(1:4)];
% other_x_points = [1 2 3 4 ; 7 8 9 10;  13 14 15 16];
% 
% 
% figure; barh1 = bar(other_x_points(1,:),[other_ordering1])
% hold on;
% barh2 = bar(other_x_points(2,:),[other_ordering2])
% hold on;
% barh3 = bar(other_x_points(3,:),[other_ordering3]);
% 
% barh1.FaceColor = [0 0 0];
% barh2.FaceColor = [1 0 0];
% barh3.FaceColor = [0 .5 .5];
% 
% 
% axis([0 17 0 .8])
% 
% these_axes = gca;
% 
% these_axes.XTick = [1 7 13 ];
% these_axes.XTickLabel = {'targ nuc', 'targ cb', 'targ neur'}