% Figure Creation Code - Matlab % matt.grove@liv.ac.uk % 2017 % Figtype1.m % Save this code as a function called 'Figtype1.m' before running the code saved in Grove_ESM2.txt function Figtype1(a,b,xdata1, zdata1, zdata2, zdata3, zdata4, zdata5, zdata6, zdata7, zdata8, zdata9) % Create figure figure1 = figure('Color',[1 1 1]); colormap(jet); % Create axes axes1 = axes('Parent',figure1,... 'Position',[0.191875 0.18941504178273 0.408125 0.742548746518106]); % Create xlabel xlabel('Reproductive Rate','FontSize',18); % Create ylabel ylabel('Cost of IL','FontSize',18); xlim(axes1,[0.1 1.1]); ylim(axes1,[0.1 1.1]); % Set the remaining axes properties set(axes1,'FontSize',14,'XAxisLocation','top','XTick',[0.1 0.5 0.9],... 'YAxisLocation','right','YTick',[0.1 0.5 0.9]); % Create axes axes2 = axes('Parent',figure1,... 'Position',[0.13 0.68140955267901 0.123739495798319 0.215735294117647]); hold(axes2,'on'); % Create contour contourf(xdata1,xdata1,zdata1,'Parent',axes2,'LineColor','none',... 'LevelStep',0.005); box(axes2,'on'); axis(axes2,'tight'); axis(axes2,'square'); % Set the remaining axes properties set(axes2,'BoxStyle','full','CLim',[a b],'FontSize',14,... 'Layer','top','XTick',[0 0.5 1],'YTick',[0 0.5 1]); % Create colorbar c=colorbar('peer',axes2,'Position',... [0.0984791673428068 0.681058495821727 0.0121458326571932 0.215877437325905],... 'FontSize',14); % Alter below for Figures 2A and 2B c.Label.String = 'Individual Learning'; % for Figures 1A and 1B % c.Label.String = 'IL Difference'; % for Figure 2A % c.Label.String = 'Fitness Difference'; % for Figure 2B c.Label.FontSize = 16; % Create axes axes3 = axes('Parent',figure1,... 'Position',[0.29281512605042 0.68140955267901 0.123739495798319 0.215735294117647]); hold(axes3,'on'); % Create contour contourf(xdata1,xdata1,zdata2,'Parent',axes3,'LineColor','none',... 'LevelStep',0.005); box(axes3,'on'); axis(axes3,'tight'); axis(axes3,'square'); % Set the remaining axes properties set(axes3,'BoxStyle','full','CLim',[a b],'FontSize',14,... 'Layer','top','XTick',[0 0.5 1],'YTick',[0 0.5 1]); % Create axes axes4 = axes('Parent',figure1,... 'Position',[0.45563025210084 0.68140955267901 0.123739495798319 0.215735294117647]); hold(axes4,'on'); % Create contour contourf(xdata1,xdata1,zdata3,'Parent',axes4,'LineColor','none',... 'LevelStep',0.005); box(axes4,'on'); axis(axes4,'tight'); axis(axes4,'square'); % Set the remaining axes properties set(axes4,'BoxStyle','full','CLim',[a b],'FontSize',14,... 'Layer','top','XTick',[0 0.5 1],'YTick',[0 0.5 1]); % Create axes axes5 = axes('Parent',figure1,... 'Position',[0.13 0.381777199737834 0.123739495798319 0.215735294117647]); hold(axes5,'on'); % Create contour contourf(xdata1,xdata1,zdata4,'Parent',axes5,'LineColor','none',... 'LevelStep',0.005); box(axes5,'on'); axis(axes5,'tight'); axis(axes5,'square'); % Set the remaining axes properties set(axes5,'BoxStyle','full','CLim',[a b],'FontSize',14,... 'Layer','top','XTick',[0 0.5 1],'YTick',[0 0.5 1]); % Create axes axes6 = axes('Parent',figure1,... 'Position',[0.29281512605042 0.381777199737834 0.123739495798319 0.215735294117647]); hold(axes6,'on'); % Create contour contourf(xdata1,xdata1,zdata5,'Parent',axes6,'LineColor','none',... 'LevelStep',0.005); box(axes6,'on'); axis(axes6,'tight'); axis(axes6,'square'); % Set the remaining axes properties set(axes6,'BoxStyle','full','CLim',[a b],'FontSize',14,... 'Layer','top','XTick',[0 0.5 1],'YTick',[0 0.5 1]); % Create axes axes7 = axes('Parent',figure1,... 'Position',[0.45563025210084 0.381777199737834 0.123739495798319 0.215735294117647]); hold(axes7,'on'); % Create contour contourf(xdata1,xdata1,zdata6,'Parent',axes7,'LineColor','none',... 'LevelStep',0.005); box(axes7,'on'); axis(axes7,'tight'); axis(axes7,'square'); % Set the remaining axes properties set(axes7,'BoxStyle','full','CLim',[a b],'FontSize',14,... 'Layer','top','XTick',[0 0.5 1],'YTick',[0 0.5 1]); % Create axes axes8 = axes('Parent',figure1,... 'Position',[0.13 0.0821448467966574 0.123739495798319 0.215735294117647]); hold(axes8,'on'); % Create contour contourf(xdata1,xdata1,zdata7,'Parent',axes8,'LineColor','none',... 'LevelStep',0.005); % Create xlabel xlabel('Environmental Change','FontSize',18); % Create ylabel ylabel('Learning Error','FontSize',18); box(axes8,'on'); axis(axes8,'tight'); axis(axes8,'square'); % Set the remaining axes properties set(axes8,'BoxStyle','full','CLim',[a b],'FontSize',14,... 'Layer','top','XTick',[0 0.5 1],'YTick',[0 0.5 1]); % Create axes axes9 = axes('Parent',figure1,... 'Position',[0.29281512605042 0.0821448467966574 0.123739495798319 0.215735294117647]); hold(axes9,'on'); % Create contour contourf(xdata1,xdata1,zdata8,'Parent',axes9,'LineColor','none',... 'LevelStep',0.005); box(axes9,'on'); axis(axes9,'tight'); axis(axes9,'square'); % Set the remaining axes properties set(axes9,'BoxStyle','full','CLim',[a b],'FontSize',14,... 'Layer','top','XTick',[0 0.5 1],'YTick',[0 0.5 1]); % Create axes axes10 = axes('Parent',figure1,... 'Position',[0.45563025210084 0.0821448467966573 0.123739495798319 0.215735294117647]); hold(axes10,'on'); % Create contour contourf(xdata1,xdata1,zdata9,'Parent',axes10,'LineColor','none',... 'LevelStep',0.005); box(axes10,'on'); axis(axes10,'tight'); axis(axes10,'square'); % Set the remaining axes properties set(axes10,'BoxStyle','full','CLim',[a b],'FontSize',14,... 'Layer','top','XTick',[0 0.5 1],'YTick',[0 0.5 1]);