function plot_grid_hmm(delta, nrows, ncols)
% delta(i,a,j) = Pr(j | i,a)

style = {'k-', 'b:', 'g--', 'r-.'};
N = size(delta, 1);
A = size(delta, 2);
xy = ind2subv([nrows ncols], 1:N);
for a=1:A
  gplot(squeeze(delta(:,a,:)), xy, style{wrap(a,length(style))});
  hold on
end
axis ij
axis([0 ncols+1 0 nrows+1])
