%plot u 
set(0, 'defaulttextinterpreter','none')

signs = ones(nbins,1)*sign(data.uship_g);
dd.x = data.dday;
dd.y = data.bins;
dd.z =  signs.*(data.umeas + ones(config.nbins,1)*data.uship_g)

%set the stage
ddcfg = aplotit(dd);
clf

cfg = aplotit(dd,ddcfg,'cur_ax',subplot(411),'reverse_ydir',1,'comment',...
              'sign(uship_g) .* (uship_g - umeas');
set(cfg.cur_ax,'ydir','reverse')

nbins = length(dd.y);
subplot(412)
colors = jet(5);
plot([min(data.dday) max(data.dday)]',[0 0],'b');hold on
for swathi = 1:5
   ii = (swathi - 1)*5 + [1:5];
   plot(data.dday,dd.z(ii,:), 'color',colors(swathi,:))
   hold on
end
xl(min(dd.x), max(dd.x))
yl(-1,8)
pos = get(gca,'pos');
boxpos = get(cfg.box_ax,'pos');
set(gca,'pos',[pos([1 2]), boxpos(3) pos(4)])


%now do v

signs = ones(nbins,1)*sign(data.vship_g);
dd.z =  signs.*(data.vmeas + ones(config.nbins,1)*data.vship_g);

cfg = aplotit(dd,ddcfg,'cur_ax',subplot(413),'reverse_ydir',1,'comment',...
              'sign(vship_g) .* (vship_g - umeas');
set(cfg.cur_ax,'ydir','reverse')

nbins = length(dd.y);
subplot(414)
colors = jet(5);
plot([min(data.dday) max(data.dday)]',[0 0],'b');hold on
for swathi = 1:5
   ii = (swathi - 1)*5 + [1:5];
   plot(data.dday, dd.z(ii,:),  'color',colors(swathi,:))
   hold on
end
xl(min(dd.x), max(dd.x))
yl(-1,8)
pos = get(gca,'pos');
boxpos = get(cfg.box_ax,'pos');
set(gca,'pos',[pos([1 2]), boxpos(3) pos(4)])

