function PlotASDRmed(fid_prefix,unitnorm,dt,t_shift,t_bound)

fpath = ['C:\Users\USER\Documents\mingfaifong\' fid_prefix '\'];
spath = fpath;

load([fpath fid_prefix '_FullRecNoWaveform.SS'],'-mat');

if nargin<2
    unitnorm = 0;
end
if nargin<3
    dt = 1;
end
if nargin<4
    t_shift = 0;
end
if nargin<5
    t_bound = [min(SS.time),max(SS.time)+dt];
end

[evt_times evt_text] = get_events(fid_prefix);


if dt >= 3600
    dt_label = [num2str(dt/3600) '-hour bins'];
elseif dt >= 60
    dt_label = [num2str(dt/60) '-minute bins'];
else
    dt_label = [num2str(dt) '-second bins'];
end

%figure('units','normalized','outerposition',[0 0 1 1])    
SS.ASDR(dt,t_bound);

keyboard
if unitnorm
    plot(SS.asdr.bin+t_shift,SS.asdr.median/max(SS.unit),'k');
    y_upperlim = max(SS.asdr.median/max(SS.unit));
    ylabel(['Unit-Normalized',10,'Array-Wide Spike Rate (Hz)'],'FontSize',14);
else
    plot(SS.asdr.bin+t_shift,SS.asdr.median,'k');
    y_upperlim = max(SS.asdr.median);
    ylabel('Array-Wide Spike Rate (Hz)','FontSize',14);
end

hold on;
fid_suffix = ['ASDR_bin' num2str(dt) 's'];

for m = 1:length(evt_times)
plot([evt_times(m)+t_shift evt_times(m)+t_shift],[0 y_upperlim],'--r');
text(evt_times(m)+t_shift,y_upperlim,evt_text{m},'Color','r','FontSize',8,'HorizontalAlignment','center','VerticalAlignment','bottom');
end

%keyboard;
set(gca,'XTick',[floor((SS.asdr.bin(1)+t_shift)/3600/4)*3600*4:4*3600:ceil((SS.asdr.bin(end)+t_shift)/3600/4)*3600*4]);
set(gca,'XTickLabel',[floor((SS.asdr.bin(1)+t_shift)/3600/4)*4:4:ceil((SS.asdr.bin(end)+t_shift)/3600/4)*4]);
xlabel([10,'Time (hours)'],'FontSize',14);
xlim([SS.asdr.bin(1),SS.asdr.bin(end)]+t_shift);

%     keyboard
% print('-depsc',[fid_prefix '/figures/' fid_prefix '_' fid_suffix '.eps']);
% print('-dpng',[fid_prefix '/figures/' fid_prefix '_' fid_suffix '.png']);
% saveas(gcf,[fid_prefix '/figures/' fid_prefix '_' fid_suffix '.fig'],'fig');