function ph = plot_grid(grid, axish)
% function ph = plot_grid(grid, axish, i)

if nargin<3
    i = 1;
end
if nargin<2
    axish = gca;
    
end
gridcol = [1 1 0];
gridwidth = 2;


T  = grid.tri_info.T;
pts = grid.tri_info.pts;

regions_ind = grid.region_tri_ind;


ph = triplot(T, pts(:,1), pts(:,2), 'Parent', axish);
plot_region_patches(regions_ind, T, pts, axish);
%if isfield(grid, 'density')
%    density = grid.density.prev;
%    plot_region_density(regions_ind, T, pts, density, axish);
%end
axis(axish, 'image', 'ij');



return
% ph = [];
% imagesc(grid.R, 'parent', axish);
% hold(axish, 'on');
% for i=1:length(regions_ind)
%     %pts = vertices(regions_ind{i},:);
%     %pts = [pts; pts(1,:)];
%  %   ph = cat(2, ph, plot(axish, pts(:,1), pts(:,2), '-', 'Color', gridcol, 'LineWidth', gridwidth));
%     if ~isempty(grid.centroids)
%         ph = cat(2, ph, text(grid.centroids(i,1), grid.centroids(i,2), num2str(i), 'Parent', axish, 'Clipping', 'on'));
%     end
% end