%%%% Figure: spatial learning behavior x,y position for animals 1 and 2
%% Animal 1
clear all
close all

load Data1_vh_dirs

dpi = 96;
fw = 4.5;
fh = 11;
figure('units','pixels','Position',[2 .4 fw fh].*dpi,'color','w')

% From left to right
H = [0.25 2.5];

% From bottom to top
V = [8.9 6.8 4.7 2.6 0.5];

% Layout of axes
pos      = [H(1)  V(1)  1.75 1.75
            H(1)  V(2)  1.75 1.75
            H(1)  V(3)  1.75 1.75
            H(1)  V(4)  1.75 1.75
            H(1)  V(5)  1.75 1.75
            
            H(2)  V(1)  1.75 1.75
            H(2)  V(2)  1.75 1.75
            H(2)  V(3)  1.75 1.75
            H(2)  V(4)  1.75 1.75
            H(2)  V(5)  1.75 1.75].*dpi;

        
for ii = 1:10
    h = axes('units','pixels','position',pos(ii,:));...

    load([visualhulldirs{ii} '\vh_xyz\vh_xyz.mat'])
    test = rot*vh_xyz.centroids;
    plot(1.125,-0.125,'or','markersize',8),hold on
    plot(-1.6964,-1.4107,'or','markersize',8)
    plot(0.2021,1.6250,'or','markersize',8)
    plot(test(1,:),test(2,:),'.k','markersize',4),...
        title(sprintf('Trial %d',ii),'FontName','arial','Fontsize',15),
    plot(0,0,'og','markersize',120,...
        'Color',[0.168627450980392 0.505882352941176 0.337254901960784],...
        'LineWidth',2)
    set(h,'xlim',[-3 3],'ylim',[-3 3],'xtick',[],'ytick',[]),axis off
end
set(gcf,'PaperPositionMode','manual','PaperUnits','inches','PaperPosition',[0 0 fw fh])

%% Animal 2
clear all
close all

load Data2_vh_dirs

dpi = 96;
fw = 7.0;
fh = 11;
figure('units','pixels','Position',[2 .4 fw fh].*dpi,'color','w')

% From left to right
H = [0.25 2.5 4.75];

% From bottom to top
V = [8.9 6.8 4.7 2.6 0.5];

% Layout of axes
pos      = [H(1)  V(1)  1.75 1.75
            H(1)  V(2)  1.75 1.75
            H(1)  V(3)  1.75 1.75
            H(1)  V(4)  1.75 1.75
            H(1)  V(5)  1.75 1.75
            
            H(2)  V(1)  1.75 1.75
            H(2)  V(2)  1.75 1.75
            H(2)  V(3)  1.75 1.75
            H(2)  V(4)  1.75 1.75
            H(2)  V(5)  1.75 1.75
            
            H(3)  V(1)  1.75 1.75
            H(3)  V(2)  1.75 1.75
            H(3)  V(3)  1.75 1.75
            H(3)  V(4)  1.75 1.75
            H(3)  V(5)  1.75 1.75].*dpi;

        
for ii = 1:15
    h = axes('units','pixels','position',pos(ii,:));...

    load([visualhulldirs{ii} '\vh_xyz\vh_xyz.mat'])
    test = rot*vh_xyz.centroids;
    plot( 0.6607,-0.1250,'or','markersize',8),hold on
    plot(-1.8036,-1.1964,'or','markersize',8)
    plot(0.2021,1.6250,'or','markersize',8)
    plot(test(1,:),test(2,:),'.k','markersize',4),...
        title(sprintf('Trial %d',ii),'FontName','arial','Fontsize',15),
    plot(0,0,'og','markersize',120,...
        'Color',[0.168627450980392 0.505882352941176 0.337254901960784],...
        'LineWidth',2)
    set(h,'xlim',[-3 3],'ylim',[-3 3],'xtick',[],'ytick',[]),axis off
end
set(gcf,'PaperPositionMode','manual','PaperUnits','inches','PaperPosition',[0 0 fw fh])
print -dtiff -r600 -zbuffer SpatialLearning_Animal2