Changeset 6631


Ignore:
Timestamp:
11/22/10 15:49:09 (14 years ago)
Author:
Mathieu Morlighem
Message:

bug fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/model/plot/plot_section.m

    r6563 r6631  
    33%
    44%   Usage:
    5 %      plot_section(md,options,width,i);
     5%      plot_section(md,data,options,nlines,ncols,i)
    66%
    77%   See also: PLOTMODEL
     
    1111
    1212        %Compute the indexes of the 2 plots (one for the sectionvalue and one for showsection
    13         upperplots=fix((i-1)/width);
    14         if upperplots==0, leftplots=i-1; else leftplots=i-width*upperplots-1; end
    15         index1=4*width*upperplots+2*leftplots+1;
     13        upperplots=floor((i-1)/ncols);
     14        if upperplots==0, leftplots=i-1; else leftplots=i-ncols*upperplots-1; end
     15        index1=4*ncols*upperplots+2*leftplots+1;
    1616        index2=index1+1;
    17         width=2*width;
     17        ncols=2*ncols;
    1818else
    1919        index1=i;
     
    7878
    7979                        %plot section only with labels
    80                         subplot(width,width,index2)
     80                        subplot(nlines,ncols,index2)
    8181                        plot_unit(x_m,y_m,z_m,elements_m,data(:,i),is2d,datatype,options)
    8282                        hold on
     
    126126
    127127                                %plot section only with labels
    128                                 subplot(width,width,index2)
     128                                subplot(nlines,ncols,index2)
    129129                                plot_unit(x_m,y_m,z_m,elements_m,data(:,i),is2d,datatype,options)
    130130                                hold on
     
    139139                        end
    140140
    141                         subplot(width,width,index1)
     141                        subplot(nlines,ncols,index1)
    142142                        A=elements(:,1); B=elements(:,2); C=elements(:,3);  D=elements(:,4);
    143143                        patch( 'Faces', [A B C D], 'Vertices', [s z zeros(length(s),1)],'FaceVertexCData',data_s,'FaceColor','interp','EdgeColor','none');
     
    161161
    162162                                %plot section only with labels
    163                                 subplot(width,width,index2)
     163                                subplot(nlines,ncols,index2)
    164164                                plot_unit(x_m,y_m,z_m,elements_m,data,is2d,datatype,options)
    165165                                hold on
     
    174174                        end
    175175
    176                         subplot(width,width,index1)
     176                        subplot(nlines,ncols,index1)
    177177                        A=elements(:,1); B=elements(:,2); C=elements(:,3);  D=elements(:,4);
    178178                        patch( 'Faces', [A B C D], 'Vertices', [x y z],'FaceVertexCData',data_s,'FaceColor','interp','EdgeColor','none');
Note: See TracChangeset for help on using the changeset viewer.