function DM_plot_profile(handles,Index)

global data

if ~isempty(data.handles.profile_line.dune)||~isempty(data.handles.profile_line.nodune)
    delete(data.handles.profile_line.dune)
    delete(data.handles.profile_line.nodune)
    data.handles.profile_line.dune = [];
    data.handles.profile_line.nodune = [];
end
hold(handles.profile,'off')
set(handles.changeprofile,'Visible','on')
h = plot(handles.profile,data.x(Index,:),data.z(Index,:),'color','k','linewidth',1);
data.handles.profile_line.profile_nodune = h;
hold(handles.profile,'on')
h = plot(handles.profile,data.x(Index,:),data.znew(Index,:),'r.-','linewidth',1);
data.handles.profile_line.profile_dune = h;
xlim(handles.profile,get(handles.nodune,'XLim'))
ylim(handles.profile,[data.profile_lim_min data.profile_lim_max])
set(handles.profile,'ytick',[data.profile_lim_min:data.profile_lim_max])
set(handles.profile,'ygrid','on')
set(handles.profile,'fontsize',8)
h = plot(handles.dune,data.x(Index,:),data.y(Index,:),'k--','linewidth',1);
data.handles.profile_line.dune = h;
h = plot(handles.nodune,data.x(Index,:),data.y(Index,:),'k--','linewidth',1);
data.handles.profile_line.nodune = h;
xlabel(handles.profile,'Cross-shore (m)','fontsize',8)
ylabel(handles.profile,'Elevation (m)','fontsize',8)
h = legend(handles.profile,'No Dune','Dune','Location','NorthWest');
set(h,'Fontsize',7)
data.handles.legend = h;