function plot(algo,dat)

if nargin<2
    dat=train(algo);
end

dat1=dat{1};
dat2=dat{2};
censoring_percentage=100-round(100*sum(dat1.X(:,end))/algo.n);



[x,y]=get_xy(dat1);

delta=x(:,end);
x=x(:,1);

h=[0:0.01:1];
l=length(h);

fig1=figure;
scatter(x(delta==1),y(delta==1),'.k');hold on;
scatter(x(delta==0),y(delta==0),'ok');hold on;

% plot(h,2+sin(2*pi*h),'r');hold on;
xlabel('Covariate (Z)','fontsize',16,'fontweight','b')
ylabel('Time','fontsize',16,'fontweight','b');
title(['n=' num2str(algo.n) ',   ' num2str(censoring_percentage) '% censored'],'fontsize',16,'fontweight','b');
h = legend('observed time','censoring time');

hold off;







