load('C:\Users\USER\Documents\mingfaifong\2013-01-30_vivy_MEA-analysis\vivy21369F_10-12DIV.mat')
%%
close all;
channel_orig = unique(channel);
channel_new = [1:length(unique(channel))]-10;
for i = 1:length(unique(channel));
    channel(channel==channel_orig(i)) = channel_new(i);
end
plot(time/3600,channel+0.15*randn(size(channel)),'.k','MarkerSize',0.5);
ylim([-10 0]);
xlim([-6 24]);

%%
load('C:\Users\USER\Documents\mingfaifong\2013-01-24_usain22493_12-14DIV_MEA_CNQX\usain22493_12-14DIV.mat');
close all;
plot(time/3600,channel+0.15*randn(size(channel)),'.k','MarkerSize',0.5);
ylim([1 64]);


%%
load('C:\Users\USER\Documents\mingfaifong\2013-01-21_trouble22468_12-14DIV_MEA_CNQX-ChR2-stim-CL\trouble22468_12-14DIV.mat');
figure
% hold on;
plot(time/3600,channel+0.15*randn(size(channel)),'.k','MarkerSize',0.5);
ylim([1 64]);


%%
x_center = -2; %in hours (-2,0,4,12,23);
x_range = 15; %in minutes
xlim([x_center-x_range/2/60 x_center+x_range/2/60]);
set(gcf,'units','centimeters','Position',[0 9 3 1]); % 4cm across, 1.5m high
set(gca,'XTick',[-6:1/60:24],'XTickLabel',[-6*60:1:24*60],'TickDir','out',...
    'YTick',[1 10],...
    'units','centimeters','Position',[0.1 0.1 3-0.1 0.9]);
box off;

%% exportfig
fid = 'RasterSnippet-CNQX6well-time23hr-width15min';
savedir = 'C:\Users\USER\Documents\mingfaifong\UpScalingPaper_figures\2013-06-16\';
export_fig([savedir fid],'-pdf','-transparent','-r300');