Changeset 1879


Ignore:
Timestamp:
08/25/09 12:23:12 (15 years ago)
Author:
Mathieu Morlighem
Message:

Added contour support in quiverplot

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

Legend:

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

    r1740 r1879  
    1 function plot_contour(md,data,options_structure);
     1function plot_contour(md,datain,options_structure);
    22%PLOT_CONTOUR - plot contours of a given field
    33%
     
    99%process data and model
    1010[x y z index is2d]=processmesh(md,options_structure);
    11 [data isongrid isquiver]=processdata(md,data,options_structure);
     11[data isongrid isquiver]=processdata(md,datain,options_structure);
    1212
    1313%check is2d
     
    1717
    1818%first, process data: must be on grids
     19if isquiver
     20        %take norm
     21        data=sqrt(sum(datain.*datain,2));
     22end
    1923if ~isongrid
     24        %take average
    2025        data=averaging(md,data,0);
    2126end
  • issm/trunk/src/m/classes/public/plot/plot_manager.m

    r1805 r1879  
    120120%process data and model
    121121[x y z elements is2d]=processmesh(md,options_structure);
    122 [data isongrid isquiver]=processdata(md,data,options_structure);
     122[data2 isongrid isquiver]=processdata(md,data,options_structure);
    123123
    124124%standard plot:
    125125subplot(width,width,i);
    126 plot_unit(x,y,z,elements,data,isongrid,is2d,isquiver,options_structure);
     126plot_unit(x,y,z,elements,data2,isongrid,is2d,isquiver,options_structure);
    127127
    128128%apply all options
    129 if isnan(options_structure.shading) & isnan(options_structure.edgecolor) & size(data,1)==md.numberofgrids,
     129if isnan(options_structure.shading) & isnan(options_structure.edgecolor) & size(data2,1)==md.numberofgrids,
    130130        options_structure.shading='interp';
    131131end
     
    133133        options_structure.colorbar=2;
    134134end
    135 applyoptions(md,data,options_structure);
     135if isquiver & (iscell(options_structure.contourlevels) | ~isnan(options_structure.contourlevels)),
     136        data2=data;
     137end
     138applyoptions(md,data2,options_structure);
Note: See TracChangeset for help on using the changeset viewer.