function plotafsCA4(Axes1, Axes2, AxesSOL1, AxesSOL2, afs1, afs2, FIRPOL1, FIRPOL2, INNPOL1, INNPOL2, isFIRPOL, isINNPOL, isAFS, lcs, lvc, lvonoff, plotopt)

fa = 0.05;

if isFIRPOL
    axes(Axes1);
    if get(plotopt(1), 'Value')
        trisurf(FIRPOL1.surf,FIRPOL1.t(:,1),FIRPOL1.t(:,2),FIRPOL1.t(:,3), 'Facecolor','k', 'Facealpha', fa);
    else
        trimesh(FIRPOL1.surf,FIRPOL1.t(:,1),FIRPOL1.t(:,2),FIRPOL1.t(:,3), 'EdgeColor','k', 'Linewidth', 0.5, 'Facealpha', fa);
    end
    hold(Axes1, 'on');
    
    set(Axes1,'XLim',afs1.xm,'YLim',afs1.ym,'ZLim',afs1.zm);
end
if isINNPOL
    axes(Axes1);
    if get(plotopt(1), 'Value')
        trisurf(INNPOL1.surf,INNPOL1.t(:,1),INNPOL1.t(:,2),INNPOL1.t(:,3), 'Facecolor','r', 'Facealpha', fa);
    else
        trimesh(INNPOL1.surf,INNPOL1.t(:,1),INNPOL1.t(:,2),INNPOL1.t(:,3), 'EdgeColor','k', 'Linewidth', 0.5, 'Facealpha', fa);
    end
    hold(Axes1, 'on');
    
    axis(Axes1, 'tight');
end

if isAFS
    for i=1:afs1.afs.nseg
        if afs1.afs.SegStruc(i,1) == 2
            if afs1.afs.seg{i}.isplane
                axes(Axes1);
                fill3(afs1.afs.seg{i}.plane(:,1), afs1.afs.seg{i}.plane(:,2), afs1.afs.seg{i}.plane(:,3), lcs(mod(afs1.afs.seg{i}.col-1,6)+1,:), 'facealpha',.15);
                hold(Axes1, 'on');
            end
        elseif afs1.afs.SegStruc(i,1) == 3
            pts = afs1.afs.lines{afs1.afs.SegStruc(i,2)}.pts;
            plot3(Axes1, pts(:,1), pts(:,2), pts(:,3), 'color', lcs(mod(afs1.afs.seg{i}.col-1,6)+1,:), 'Linewidth',3);
            hold(Axes1, 'on');
        end
        for j=1:length(afs1.afs.seg{i}.line)
            plot3(Axes1, afs1.afs.pts(afs1.afs.seg{i}.line{j}.lin,1), afs1.afs.pts(afs1.afs.seg{i}.line{j}.lin,2), afs1.afs.pts(afs1.afs.seg{i}.line{j}.lin,3), 'color', lcs(mod(afs1.afs.seg{i}.col-1,6)+1,:));
            hold(Axes1, 'on');
        end
    end
    set(Axes1,'XLim',afs1.xm,'YLim',afs1.ym,'ZLim',afs1.zm);
end

xlabel(Axes1, 'x')
ylabel(Axes1, 'y')
zlabel(Axes1, 'z')

hold(Axes1,'off');

if isFIRPOL
    axes(Axes2);
    if get(plotopt(1), 'Value')
        trisurf(FIRPOL2.surf,FIRPOL2.t(:,1),FIRPOL2.t(:,2),FIRPOL2.t(:,3), 'Facecolor','k', 'Facealpha', fa);
    else
        trimesh(FIRPOL2.surf,FIRPOL2.t(:,1),FIRPOL2.t(:,2),FIRPOL2.t(:,3), 'EdgeColor','k', 'Linewidth', 0.5, 'Facealpha', fa);
    end
    hold(Axes2, 'on');
    
    set(Axes2,'XLim',afs2.xm,'YLim',afs2.ym,'ZLim',afs2.zm);
end
if isINNPOL
    axes(Axes2);
    if get(plotopt(1), 'Value')
        trisurf(INNPOL2.surf,INNPOL2.t(:,1),INNPOL2.t(:,2),INNPOL2.t(:,3), 'Facecolor','r', 'Facealpha', fa);
    else
        trimesh(INNPOL2.surf,INNPOL2.t(:,1),INNPOL2.t(:,2),INNPOL2.t(:,3), 'EdgeColor','k', 'Linewidth', 0.5, 'Facealpha', fa);
    end
    hold(Axes2, 'on');
    
    axis(Axes2, 'tight');
end

if isAFS
    for i=1:afs2.afs.nseg
        if afs2.afs.SegStruc(i,1) == 2
            if afs2.afs.seg{i}.isplane
                axes(Axes2);
                fill3(afs2.afs.seg{i}.plane(:,1), afs2.afs.seg{i}.plane(:,2), afs2.afs.seg{i}.plane(:,3), lcs(mod(afs2.afs.seg{i}.col-1,6)+1,:), 'facealpha',.15);
                hold(Axes2, 'on');
            end
        elseif afs2.afs.SegStruc(i,1) == 3
            pts = afs2.afs.lines{afs2.afs.SegStruc(i,2)}.pts;
            plot3(Axes2, pts(:,1), pts(:,2), pts(:,3), 'color', lcs(mod(afs2.afs.seg{i}.col-1,6)+1,:), 'Linewidth',3);
            hold(Axes2, 'on');
        end
        for j=1:length(afs2.afs.seg{i}.line)
            plot3(Axes2, afs2.afs.pts(afs2.afs.seg{i}.line{j}.lin,1), afs2.afs.pts(afs2.afs.seg{i}.line{j}.lin,2), afs2.afs.pts(afs2.afs.seg{i}.line{j}.lin,3), 'color', lcs(mod(afs2.afs.seg{i}.col-1,6)+1,:));
            hold(Axes2, 'on');
        end
    end
    set(Axes2,'XLim',afs2.xm,'YLim',afs2.ym,'ZLim',afs2.zm);
end

xlabel(Axes2, 'x')
ylabel(Axes2, 'y')
zlabel(Axes2, 'z')

hold(Axes2,'off');
