Changeset 7651


Ignore:
Timestamp:
03/15/11 14:50:32 (14 years ago)
Author:
Eric.Larour
Message:

Can do 3d surface plots now in 2D, using the 'z' option

Location:
issm/trunk/src/m/model/plot
Files:
4 edited

Legend:

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

    r7547 r7651  
    6969        end
    7070end
     71
     72if exist(options,'z'),
     73        axis square;
     74end
     75
    7176
    7277%xlim
  • issm/trunk/src/m/model/plot/plot_manager.m

    r7644 r7651  
    173173%plot unit
    174174h=plot_unit(x,y,z,elements,data2,is2d,datatype,options);
     175       
    175176
    176177%apply all options
  • issm/trunk/src/m/model/plot/plot_unit.m

    r7098 r7651  
    2121                pos=find(~isnan(data)); %needed for element on water
    2222                if is2d,
    23                         A=elements(pos,1); B=elements(pos,2); C=elements(pos,3);
    24                         h=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);
     23                        A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); h=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);
    2524                else
    2625                        A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
  • issm/trunk/src/m/model/plot/processmesh.m

    r7028 r7651  
    2626                y2d=md.y2d;
    2727        end
     28
     29        z_field=getfieldvalue(options,'z',md.z);
     30        if ischar(z_field),
     31                z=md.(z_field);
     32        elseif isnumeric(z_field),
     33                z=z_field;
     34        else
    2835                z=md.z;
    29                 z2d=md.z2d;
    30                 elements2d=md.elements2d;
    31                 elements=md.elements;
    32                 elements_type2d=md.elements_type2d;
     36        end
     37
     38
     39        z2d=md.z2d;
     40        elements2d=md.elements2d;
     41        elements=md.elements;
     42        elements_type2d=md.elements_type2d;
    3343
    3444        %is it a 2d plot?
Note: See TracChangeset for help on using the changeset viewer.