Changeset 1740


Ignore:
Timestamp:
08/18/09 07:55:50 (16 years ago)
Author:
Mathieu Morlighem
Message:

Added quiver plot if data given in input has several columns

Location:
issm/trunk/src/m/classes/public/plot
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/classes/public/plot/plot_basaldrag.m

    r27 r1740  
    3939        %process data and model
    4040        [x y z elements is2d]=processmesh(md,options_structure);
    41         [basal_drag isongrid]=processdata(md,drag,options_structure);
     41        [basal_drag isongrid isquiver]=processdata(md,drag,options_structure);
    4242
    4343        %plot basaldrag
    4444        subplot(width,width,i);
    45         plot_unit(x,y,z,elements,basal_drag,isongrid,is2d,options_structure);
     45        plot_unit(x,y,z,elements,basal_drag,isongrid,is2d,isquiver,options_structure);
    4646
    4747        %apply options
  • issm/trunk/src/m/classes/public/plot/plot_contour.m

    r844 r1740  
    99%process data and model
    1010[x y z index is2d]=processmesh(md,options_structure);
    11 [data isongrid]=processdata(md,data,options_structure);
     11[data isongrid isquiver]=processdata(md,data,options_structure);
    1212
    1313%check is2d
  • issm/trunk/src/m/classes/public/plot/plot_drivingstress.m

    r338 r1740  
    1212%process data and model
    1313[x y z elements is2d]=processmesh(md,options_structure);
    14 [dstress isongrid]=processdata(md,s,options_structure);
     14[dstress isongrid isquiver]=processdata(md,s,options_structure);
    1515dstress=dstress/1000;
    1616
    1717%plot mesh quivervel
    1818subplot(width,width,i);
    19 plot_unit(x,y,z,elements,dstress,isongrid,is2d,options_structure)
     19plot_unit(x,y,z,elements,dstress,isongrid,is2d,isquiver,options_structure)
    2020
    2121%apply options
  • issm/trunk/src/m/classes/public/plot/plot_elementstype.m

    r1651 r1740  
    99%process data and model
    1010[x y z elements is2d]=processmesh(md,options_structure);
    11 [data1 isongrid]=processdata(md,md.elements_type(:,1),options_structure);
    12 [data2 isongrid]=processdata(md,md.elements_type(:,2),options_structure);
     11[data1 isongrid isquiver]=processdata(md,md.elements_type(:,1),options_structure);
     12[data2 isongrid isquiver]=processdata(md,md.elements_type(:,2),options_structure);
    1313data=[data1 data2];
    1414
  • issm/trunk/src/m/classes/public/plot/plot_gridnumbering.m

    r1 r1740  
    99%process data and model
    1010[x y z elements is2d]=processmesh(md,options_structure);
    11 [gridnumbers isongrid]=processdata(md,[1:md.numberofgrids]',options_structure);
     11[gridnumbers isongrid isquiver]=processdata(md,[1:md.numberofgrids]',options_structure);
    1212
    1313%plot
  • issm/trunk/src/m/classes/public/plot/plot_highlightgrids.m

    r1 r1740  
    99%process data and model
    1010[x y z elements is2d]=processmesh(md,options_structure);
    11 [gridnumbers isongrid]=processdata(md,[1:md.numberofgrids]',options_structure);
     11[gridnumbers isongrid isquiver]=processdata(md,[1:md.numberofgrids]',options_structure);
    1212
    1313%plot
  • issm/trunk/src/m/classes/public/plot/plot_manager.m

    r1110 r1740  
    126126%process data and model
    127127[x y z elements is2d]=processmesh(md,options_structure);
    128 [data isongrid]=processdata(md,data,options_structure);
     128[data isongrid isquiver]=processdata(md,data,options_structure);
    129129
    130130%standard plot:
    131131subplot(width,width,i);
    132 plot_unit(x,y,z,elements,data,isongrid,is2d,options_structure);
     132plot_unit(x,y,z,elements,data,isongrid,is2d,isquiver,options_structure);
    133133
    134134%apply all options
  • issm/trunk/src/m/classes/public/plot/plot_overlay.m

    r1295 r1740  
    2121        %process mesh and data
    2222        [x y z elements is2d]=processmesh(md,options_structure);
    23         [data isongrid]=processdata(md,data,options_structure);
     23        [data isongrid isquiver]=processdata(md,data,options_structure);
    2424
    2525        %apply caxis if required
     
    7272        %process mesh and data
    7373        [x y z elements is2d]=processmesh(md,options_structure);
    74         [data isongrid]=processdata(md,data,options_structure);
     74        [data isongrid isquiver]=processdata(md,data,options_structure);
    7575
    7676        %get previous result
  • issm/trunk/src/m/classes/public/plot/plot_quiver.m

    r27 r1740  
    99%process data and model
    1010[x y z elements is2d]=processmesh(md,options_structure);
    11 [vx isongrid]=processdata(md,md.vx,options_structure);
    12 [vy isongrid]=processdata(md,md.vy,options_structure);
     11[vx isongrid isquiver]=processdata(md,md.vx,options_structure);
     12[vy isongrid isquiver]=processdata(md,md.vy,options_structure);
    1313
    1414%plot mesh quivervel
  • issm/trunk/src/m/classes/public/plot/plot_quiver3.m

    r27 r1740  
    99%process data and model
    1010[x y z elements is2d]=processmesh(md,options_structure);
    11 [vx isongrid]=processdata(md,md.vx,options_structure);
    12 [vy isongrid]=processdata(md,md.vy,options_structure);
    13 [vz isongrid]=processdata(md,md.vz,options_structure);
     11[vx isongrid isquiver]=processdata(md,md.vx,options_structure);
     12[vy isongrid isquiver]=processdata(md,md.vy,options_structure);
     13[vz isongrid isquiver]=processdata(md,md.vz,options_structure);
    1414
    1515%plot mesh quivervel3
  • issm/trunk/src/m/classes/public/plot/plot_quivervel.m

    r338 r1740  
    99%process data and model
    1010[x y z elements is2d]=processmesh(md,options_structure);
    11 [vx isongrid]=processdata(md,md.vx,options_structure);
    12 [vy isongrid]=processdata(md,md.vy,options_structure);
     11[vx isongrid isquiver]=processdata(md,md.vx,options_structure);
     12[vy isongrid isquiver]=processdata(md,md.vy,options_structure);
    1313if ~isnan(md.vz)
    14         [vz isongrid]=processdata(md,md.vz,options_structure);
     14        [vz isongrid isquiver]=processdata(md,md.vz,options_structure);
    1515end
    1616
     
    2828subplot(width,width,i);
    2929colormap('default')
    30 plot_unit(x,y,z,elements,sqrt(vx.^2+vy.^2),isongrid,is2d,options_structure)
     30plot_unit(x,y,z,elements,sqrt(vx.^2+vy.^2),isongrid,is2d,isquiver,options_structure)
    3131
    3232if is2d
  • issm/trunk/src/m/classes/public/plot/plot_section.m

    r1171 r1740  
    2222%process data and model
    2323[x_m y_m z_m elements_m is2d]=processmesh(md,options_structure);
    24 [data isongrid]=processdata(md,data,options_structure);
     24[data isongrid isquiver]=processdata(md,data,options_structure);
    2525
    2626%replug x and y onto model so that SectionValue treats the problem correctly
     
    6262                %plot section only with labels
    6363                subplot(width,width,index2)
    64                 plot_unit(x_m,y_m,z_m,elements_m,data,isongrid,is2d,options_structure)
     64                plot_unit(x_m,y_m,z_m,elements_m,data,isongrid,is2d,isquiver,options_structure)
    6565                hold on
    6666                text(x(1),y(1),'1','backgroundcolor',[0.8 0.9 0.8])
     
    9898                        %plot section only with labels
    9999                        subplot(width,width,index2)
    100                         plot_unit(x_m,y_m,z_m,elements_m,data,isongrid,is2d,options_structure)
     100                        plot_unit(x_m,y_m,z_m,elements_m,data,isongrid,is2d,isquiver,options_structure)
    101101                        hold on
    102102                        text(x(1),y(1),'1','backgroundcolor',[0.8 0.9 0.8])
     
    132132                        %plot section only with labels
    133133                        subplot(width,width,index2)
    134                         plot_unit(x_m,y_m,z_m,elements_m,data,isongrid,is2d,options_structure)
     134                        plot_unit(x_m,y_m,z_m,elements_m,data,isongrid,is2d,isquiver,options_structure)
    135135                        hold on
    136136                        text(x(1),y(1),'1','backgroundcolor',[0.8 0.9 0.8])
  • issm/trunk/src/m/classes/public/plot/plot_streamlines.m

    r27 r1740  
    1111%process data and model
    1212[x y z index is2d]=processmesh(md,options_structure);
    13 [u isongrid]=processdata(md,md.vx,options_structure);
    14 [v isongrid]=processdata(md,md.vy,options_structure);
     13[u isongrid isquiver]=processdata(md,md.vx,options_structure);
     14[v isongrid isquiver]=processdata(md,md.vy,options_structure);
    1515
    1616%some checks
  • issm/trunk/src/m/classes/public/plot/plot_tensor_components.m

    r338 r1740  
    2525%process data and model
    2626[x y z elements is2d]=processmesh(md,options_structure);
    27 [tensor.xx isongrid]=processdata(md,tensor.xx,options_structure);
    28 [tensor.yy isongrid]=processdata(md,tensor.yy,options_structure);
    29 [tensor.xy isongrid]=processdata(md,tensor.xy,options_structure);
     27[tensor.xx isongrid isquiver]=processdata(md,tensor.xx,options_structure);
     28[tensor.yy isongrid isquiver]=processdata(md,tensor.yy,options_structure);
     29[tensor.xy isongrid isquiver]=processdata(md,tensor.xy,options_structure);
    3030if  strcmpi(md.type,'3d')
    31         [tensor.xz isongrid]=processdata(md,tensor.xz,options_structure);
    32         [tensor.yz isongrid]=processdata(md,tensor.yz,options_structure);
    33         [tensor.zz isongrid]=processdata(md,tensor.zz,options_structure);
     31        [tensor.xz isongrid isquiver]=processdata(md,tensor.xz,options_structure);
     32        [tensor.yz isongrid isquiver]=processdata(md,tensor.yz,options_structure);
     33        [tensor.zz isongrid isquiver]=processdata(md,tensor.zz,options_structure);
    3434end
    3535
    3636if (strcmpi(md.type,'2d')),
    3737        subplot(2*width,2*width,index1),
    38         plot_unit(x,y,z,elements,tensor.xx,isongrid,is2d,options_structure)
     38        plot_unit(x,y,z,elements,tensor.xx,isongrid,is2d,isquiver,options_structure)
    3939        Apply_options_tensor(md,options_structure,type,'xx')
    4040        subplot(2*width,2*width,index2),
    41         plot_unit(x,y,z,elements,tensor.yy,isongrid,is2d,options_structure)
     41        plot_unit(x,y,z,elements,tensor.yy,isongrid,is2d,isquiver,options_structure)
    4242        Apply_options_tensor(md,options_structure,type,'yy')
    4343        subplot(2*width,2*width,index3),
    44         plot_unit(x,y,z,elements,tensor.xy,isongrid,is2d,options_structure)
     44        plot_unit(x,y,z,elements,tensor.xy,isongrid,is2d,isquiver,options_structure)
    4545        Apply_options_tensor(md,options_structure,type,'xy')
    4646else
    4747        subplot(3*width,3*width,index1),
    48         plot_unit(x,y,z,elements,tensor.xx,isongrid,is2d,options_structure)
     48        plot_unit(x,y,z,elements,tensor.xx,isongrid,is2d,isquiver,options_structure)
    4949        Apply_options_tensor(md,options_structure,type,'xx')
    5050        subplot(3*width,3*width,index2),
    51         plot_unit(x,y,z,elements,tensor.yy,isongrid,is2d,options_structure)
     51        plot_unit(x,y,z,elements,tensor.yy,isongrid,is2d,isquiver,options_structure)
    5252        Apply_options_tensor(md,options_structure,type,'yy')
    5353        subplot(3*width,3*width,index3),
    54         plot_unit(x,y,z,elements,tensor.zz,isongrid,is2d,options_structure)
     54        plot_unit(x,y,z,elements,tensor.zz,isongrid,is2d,isquiver,options_structure)
    5555        Apply_options_tensor(md,options_structure,type,'zz')
    5656        subplot(3*width,3*width,index4),
    57         plot_unit(x,y,z,elements,tensor.xy,isongrid,is2d,options_structure)
     57        plot_unit(x,y,z,elements,tensor.xy,isongrid,is2d,isquiver,options_structure)
    5858        Apply_options_tensor(md,options_structure,type,'xy')
    5959        subplot(3*width,3*width,index5),
    60         plot_unit(x,y,z,elements,tensor.xz,isongrid,is2d,options_structure)
     60        plot_unit(x,y,z,elements,tensor.xz,isongrid,is2d,isquiver,options_structure)
    6161        Apply_options_tensor(md,options_structure,type,'xz')
    6262        subplot(3*width,3*width,index6),
    63         plot_unit(x,y,z,elements,tensor.yz,isongrid,is2d,options_structure)
     63        plot_unit(x,y,z,elements,tensor.yz,isongrid,is2d,isquiver,options_structure)
    6464        Apply_options_tensor(md,options_structure,type,'yz')
    6565end
  • issm/trunk/src/m/classes/public/plot/plot_tensor_principal.m

    r338 r1740  
    3838%now plot principal values
    3939[x y z elements is2d]=processmesh(md,options_structure);
    40 [tensor.principalvalue1 isongrid]=processdata(md,tensor.principalvalue1,options_structure);
    41 [tensor.principalvalue2 isongrid]=processdata(md,tensor.principalvalue2,options_structure);
     40[tensor.principalvalue1 isongrid isquiver]=processdata(md,tensor.principalvalue1,options_structure);
     41[tensor.principalvalue2 isongrid isquiver]=processdata(md,tensor.principalvalue2,options_structure);
    4242if  strcmpi(md.type,'3d')
    43         [tensor.principalvalue3 isongrid]=processdata(md,tensor.principalvalue3,options_structure);
     43        [tensor.principalvalue3 isongrid isquiver]=processdata(md,tensor.principalvalue3,options_structure);
    4444end
    4545
    4646if (strcmpi(md.type,'2d')),
    4747        subplot(2*width,2*width,index3)
    48         plot_unit(x,y,z,elements,tensor.principalvalue1,isongrid,is2d,options_structure)
     48        plot_unit(x,y,z,elements,tensor.principalvalue1,isongrid,is2d,isquiver,options_structure)
    4949        Apply_options_tensor(md,options_structure,type,'principal value 1')
    5050        subplot(2*width,2*width,index4)
    51         plot_unit(x,y,z,elements,tensor.principalvalue2,isongrid,is2d,options_structure)
     51        plot_unit(x,y,z,elements,tensor.principalvalue2,isongrid,is2d,isquiver,options_structure)
    5252        Apply_options_tensor(md,options_structure,type,'principal value 2')
    5353else
    5454        subplot(3*width,3*width,index4)
    55         plot_unit(x,y,z,elements,tensor.principalvalue1,isongrid,is2d,options_structure)
     55        plot_unit(x,y,z,elements,tensor.principalvalue1,isongrid,is2d,isquiver,options_structure)
    5656        Apply_options_tensor(md,options_structure,type,'principal value 1')
    5757        subplot(3*width,3*width,index5)
    58         plot_unit(x,y,z,elements,tensor.principalvalue2,isongrid,is2d,options_structure)
     58        plot_unit(x,y,z,elements,tensor.principalvalue2,isongrid,is2d,isquiver,options_structure)
    5959        Apply_options_tensor(md,options_structure,type,'principal value 2')
    6060        subplot(3*width,3*width,index6)
    61         plot_unit(x,y,z,elements,tensor.principalvalue3,isongrid,is2d,options_structure)
     61        plot_unit(x,y,z,elements,tensor.principalvalue3,isongrid,is2d,isquiver,options_structure)
    6262        Apply_options_tensor(md,options_structure,type,'principal value 3')
    6363end
  • issm/trunk/src/m/classes/public/plot/plot_tensor_principalaxis.m

    r27 r1740  
    1616        eval(['Vx=tensor.principalaxis' type(end) '(:,1); Vy=tensor.principalaxis' type(end) '(:,2);'])
    1717        eval(['value=tensor.principalvalue' type(end) ';']);
    18         [Vx isongrid]=processdata(md,Vx,options_structure);
    19         [Vy isongrid]=processdata(md,Vy,options_structure);
    20         [value isongrid]=processdata(md,value,options_structure);
     18        [Vx isongrid isquiver]=processdata(md,Vx,options_structure);
     19        [Vy isongrid isquiver]=processdata(md,Vy,options_structure);
     20        [value isongrid isquiver]=processdata(md,value,options_structure);
    2121else
    2222        eval(['Vx=tensor.principalaxis' type(end) '(:,1); Vy=tensor.principalaxis' type(end) '(:,2); Vz=tensor.principalaxis' type(end) '(:,3);'])
    23         [Vx isongrid]=processdata(md,Vx,options_structure);
    24         [Vy isongrid]=processdata(md,Vy,options_structure);
    25         [Vz isongrid]=processdata(md,Vz,options_structure);
    26         [value isongrid]=processdata(md,value,options_structure);
     23        [Vx isongrid isquiver]=processdata(md,Vx,options_structure);
     24        [Vy isongrid isquiver]=processdata(md,Vy,options_structure);
     25        [Vz isongrid isquiver]=processdata(md,Vz,options_structure);
     26        [value isongrid isquiver]=processdata(md,value,options_structure);
    2727end
    2828
  • issm/trunk/src/m/classes/public/plot/plot_transient_movie.m

    r1606 r1740  
    2424
    2525                %process data
    26                 [data isongrid]=processdata(md,data,options_structure);
     26                [data isongrid isquiver]=processdata(md,data,options_structure);
    2727                titlestring=[field ' at time ' num2str(md.results.transient(i).time/md.yts) ' year'];
    28                 plot_unit(x,y,z,elements,data,isongrid,is2d,options_structure)
     28                plot_unit(x,y,z,elements,data,isongrid,is2d,isquiver,options_structure)
    2929                apply_options_movie(md,options_structure,titlestring);
    3030               
  • issm/trunk/src/m/classes/public/plot/plot_unit.m

    r1261 r1740  
    1 function plot_unit(x,y,z,elements,data,isongrid,is2d,options_structure)
     1function plot_unit(x,y,z,elements,data,isongrid,is2d,isquiver,options_structure)
    22%PLOT_UNIT - unit plot, display data
    33%
    44%   Usage:
    5 %      plot_unit(x,y,z,elements,data,isongrid,is2d,options_structure);
     5%      plot_unit(x,y,z,elements,data,isongrid,is2d,isquiver,options_structure);
    66%
    77%   See also: PLOTMODEL, PLOT_MANAGER
     
    1414end
    1515
    16 %element data
    17 if ~isongrid
    18         pos=find(~isnan(data)); %needed fpr element on water
    19         if is2d
    20                 A=elements(pos,1); B=elements(pos,2); C=elements(pos,3);
    21                 patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);
    22         else
    23                 A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
    24                 patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);
    25                 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);
    26                 patch( 'Faces', [A B E D], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);
    27                 patch( 'Faces', [B E F C ], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);
    28                 patch( 'Faces', [C A D F ], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);
    29         end
    30 %grid data
    31 elseif isongrid
    32         if is2d
    33                 A=elements(:,1); B=elements(:,2); C=elements(:,3);
    34                 patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor);
    35         else
    36                 if options_structure.layer>=1,
     16%regular plot
     17if ~isquiver,
     18
     19        %element data
     20        if ~isongrid
     21                pos=find(~isnan(data)); %needed fpr element on water
     22                if is2d,
     23                        A=elements(pos,1); B=elements(pos,2); C=elements(pos,3);
     24                        patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);
     25                else
     26                        A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
     27                        patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);
     28                        patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);
     29                        patch( 'Faces', [A B E D], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);
     30                        patch( 'Faces', [B E F C ], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);
     31                        patch( 'Faces', [C A D F ], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);
     32                end
     33
     34        %grid data
     35        elseif isongrid
     36                if is2d,
    3737                        A=elements(:,1); B=elements(:,2); C=elements(:,3);
    3838                        patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor);
     
    4646                end
    4747        end
     48
     49%quiver
     50elseif isquiver,
     51
     52        %grid data
     53        if isongrid,
     54                if is2d,
     55                        quivercolor(x,y,data(:,1),data(:,2));
     56                else
     57                        quivercolor3(x,y,z,data(:,1),data(:,2),data(:,3));
     58                end
     59        else
     60                error('plot_unit error message: element quiver not implemented yet')
     61        end
    4862end
  • issm/trunk/src/m/classes/public/plot/processdata.m

    r1218 r1740  
    1 function [data isongrid]=processdata(md,data,options_structure);
     1function [data isongrid isquiver]=processdata(md,data,options_structure);
    22%PROCESSDATA - process data to be plotted
    33%
    44%   Usage:
    5 %      [data isongrid]=processdata(md,data,options_structure);
     5%      [data isongrid isquiver]=processdata(md,data,options_structure);
    66%
    77%   See also: PLOTMODEL, PROCESSMESH
    88
    99%check format
    10 if (iscell(data) | isempty(data)),
     10if (iscell(data) | isempty(data) | isnan(data)),
    1111        error('plotmodel error message: data provided is empty');
    1212end
    1313
    14 %make a column out of data
    15 data=data(:);
     14%transpose data if necessary
     15if (size(data,2) > size(data,1)),
     16        data=data';
     17end
     18datasize=size(data);
    1619
    1720%check length
    18 if length(data)~=md.numberofgrids & length(data)~=md.numberofelements & length(data)~=md.numberofgrids*6 & (strcmpi(md.type,'2d') | length(data)~=md.numberofgrids2d)
     21if datasize(1)~=md.numberofgrids & datasize(1)~=md.numberofelements & datasize(1)~=md.numberofgrids*6 & (strcmpi(md.type,'2d') | datasize(1)~=md.numberofgrids2d)
    1922        error('plotmodel error message: data not supproted yet')
    2023end
    2124
    22 %treat the case length(data)=6*grids
    23 if length(data)==6*md.numberofgrids
     25%isquiver?
     26if datasize(2)>1,
     27        isquiver=1;
     28
     29        %check number of columns, add zeros if necessary,
     30        if (strcmpi(md.type,'3d'))
     31                if datasize(2)==2,
     32                        data=[data, zeros(datasize(1),1)];
     33                elseif datasize(2)~=3,
     34                        error('plotmodel error message: data provided should have 2 or 3 columns for quiver plot, and 1 for regular plot');
     35                end
     36        elseif (strcmpi(md.type,'2d') & datasize(2)~=2),
     37                error('plotmodel error message: data provided should have 2 columns for quiver plot, and 1 for regular plot');
     38        end
     39
     40else
     41        isquiver=0;
     42end
     43
     44%treat the case datasize(1)=6*grids
     45if datasize(1)==6*md.numberofgrids
    2446        %keep the only norm of data
    25         data1=data(1:6:md.numberofgrids*6);
    26         data2=data(2:6:md.numberofgrids*6);
     47        data1=data(1:6:md.numberofgrids*6,:);
     48        data2=data(2:6:md.numberofgrids*6,:);
    2749        data=sqrt(data1.^2+data2.^2);
    2850        %---> go to grid data
    2951end
    3052
    31 %treat the case length(data)=grids2d
    32 if (strcmpi(md.type,'3d') & length(data)==md.numberofgrids2d),
     53%treat the case datasize(1)=grids2d
     54if (strcmpi(md.type,'3d') & datasize(1)==md.numberofgrids2d),
    3355        data=project3d(md,data,'node');
    3456        %---> go to grid data
     
    4264
    4365%element data
    44 if length(data)==md.numberofelements;
     66if datasize(1)==md.numberofelements;
    4567        isongrid=0;
    4668
    4769        %ice sheet only?
    4870        if ~isnan(options_structure.noiceshelf) & options_structure.noiceshelf,
    49                 data(find(md.elementoniceshelf))=NaN;
     71                data(find(md.elementoniceshelf),:)=NaN;
    5072        end
    5173        %ice shelf only?
    5274        if ~isnan(options_structure.noicesheet) & options_structure.noicesheet,
    53                 data(find(~md.elementoniceshelf))=NaN;
     75                data(find(~md.elementoniceshelf),:)=NaN;
    5476        end
    5577        %no water?
    5678        if ~isnan(options_structure.nowater) & options_structure.nowater,
    57                 data(find(md.elementonwater))=NaN;
     79                data(find(md.elementonwater),:)=NaN;
    5880        end
    5981        %log?
     
    6587
    6688%grid data
    67 if length(data)==md.numberofgrids
     89if datasize(1)==md.numberofgrids
    6890        isongrid=1;
    6991        %ice sheet only?
    7092        if ~isnan(options_structure.noiceshelf) & options_structure.noiceshelf,
    7193                pos=find(md.gridoniceshelf);
    72                 data(pos)=NaN;
     94                data(pos,:)=NaN;
    7395        end
    7496        %ice shelf only?
    7597        if ~isnan(options_structure.noiceshelf) & options_structure.noicesheet,
    7698                pos=find(md.gridonicesheet);
    77                 data(pos)=NaN;
     99                data(pos,:)=NaN;
    78100        end
    79101        %no water?
    80102        if ~isnan(options_structure.nowater) & options_structure.nowater,
    81103                pos=find(md.gridonwater);
    82                 data(pos)=NaN;
     104                data(pos,:)=NaN;
    83105        end
    84106        %log?
Note: See TracChangeset for help on using the changeset viewer.