function maxE=plotE2(node,elem,BFaces,FacesOfElements,E,figureNum,alpha)

%面坐标
xx=[node(elem(:,1),1)';node(elem(:,2),1)';node(elem(:,3),1)']; 
yy=[node(elem(:,1),2)';node(elem(:,2),2)';node(elem(:,3),2)']; 
zz=[node(elem(:,1),3)';node(elem(:,2),3)';node(elem(:,3),3)']; 
EE=zeros(3,length(elem));
%面所在体
Index=zeros(length(elem),2);
Index2=zeros(length(elem),3);
for i=1:length(elem)
    temp=find(ismember(BFaces,elem(i,:),'rows'));
    n=find(FacesOfElements==temp);
    n=n(1,1);
    Index(i,1)=fix((n-1)/4)+1;
    Index(i,2)=n-(Index(i,1)-1)*4;
    
    if Index(i,2)==1
        Index2(i,1)=1;Index2(i,2)=2;Index2(i,3)=3;
    elseif Index(i,2)==2
        Index2(i,1)=1;Index2(i,2)=2;Index2(i,3)=4;
    elseif Index(i,2)==3
        Index2(i,1)=1;Index2(i,2)=3;Index2(i,3)=4;
    elseif Index(i,2)==4
        Index2(i,1)=2;Index2(i,2)=3;Index2(i,3)=4;
    end
    
    for j=1:3
       EE(j,i)=E(Index(i,1),Index2(i,j));
    end
end
maxE=max(EE);
maxE=max(maxE);
%绘制图像
figure(figureNum);
h1=fill3(xx,yy,zz,EE);
set(h1,'edgecolor','black','edgealpha',alpha);
shading interp %插值绘制
% axis equal; axis tight;

%坐标轴
xlabel('X');
ylabel('Y');
zlabel('Z');

%colorbar设置
colorbar;
colormap jet;
% if min(real(E))==max(real(E))
%     delta=min(real(E))*0.01;
%     caxis([min(real(E))-delta max(real(E))+delta]);
% else
%     caxis([min(real(E)) max(real(E))]);
% end

end