function PlotFringes(fighand)
% PlotFringes(FIGHANDLE)
% This function accepts the handle FIGHANDLE to the main GUI figure and
% plots the fringe pattern (calculated using CalcFringes) in the GUI axes.

% get handles structure and initialize
handles=guidata(fighand);
meshstruct = handles.mesh;
meshdata=meshstruct.size;
x=meshstruct.xcoords;
y=meshstruct.ycoords;
np=meshstruct.connect;

fringestruct = handles.fringes;
fringe_shade = fringestruct.frinsha;

% use grayscale colormap
colormap(gray);
cmax = 1.0; cmin = 0.0; a = [cmin cmax]; caxis(a);
axes(handles.axes1);

% use trimesh to plot fringe pattern
trimesh(np,x,y,zeros(size(x)),fringe_shade,'FaceColor','interp','EdgeColor','interp');
axis equal;
view(2)

colorbar('EastOutside')

hold off
