function plotmodel(event)

frame=event;

fem=getdata(frame);

surfacetype=frame.get('surfaceplot').getSelectedIndex;
heighttype=frame.get('heightplot').getSelectedIndex;
plotpos=frame.get('plotpos').getSelectedIndex;

title='';
s=upper('2');
switch surfacetype
    case 1
       options={'tridata','T'};
       title='Surface: Temperature [K]  ';
    case 2
       options={'tridata','flux_ht','cont','internal'};
       title='Surface: Heat flux [W/m<sup>2</sup>]  ';
end

if plotpos==1
    parent=frame.get('axis').getHandle;
    cla(parent);
    options={options{:},...
            'parent',parent};
end

switch heighttype
    case 1  
     options={options{:},...
              'title',title};
     postplot(fem, ...
             'trimap','jet(1024)', ...
             'refine',3, ...
             'geom','off',...
             options{:});
    case 2
      title=[title, 'Height: Temperature [K]'];
      options={options{:},...
              'title',title};
      postplot(fem, ...
             'triz','T', ...
             'trimap','jet(1024)', ...
             'refine',3, ...
             'geom','off',...
             'grid','on',...
             options{:});
    case 3
      title=[title,'Height: Heat flux [W/m<sup>2</sup>]'];
      options={options{:},...
              'title',title};
      postplot(fem, ...
             'triz',{'flux_ht','cont','internal'}, ...
             'trimap','jet(1024)', ...
             'refine',3, ...
             'geom','off',...
             'grid','on',...
              options{:});
end


