Changeset 12375


Ignore:
Timestamp:
06/06/12 14:18:43 (13 years ago)
Author:
Mathieu Morlighem
Message:

Fixed plot_profile

Location:
issm/trunk-jpl/src/m/model
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/model/ProfileValues.m

    r12374 r12375  
    1515
    1616%Some useful parameters
    17 layers=ceil(mean(md.geometry.thickness)/res_v);
    18 Z=bed:resolution:surface;
     17layers=ceil(mean(md.geometry.thickness)/resolution);
     18Z=(bed:resolution:surface)';
    1919X=xprof*ones(size(Z));
    2020Y=yprof*ones(size(Z));
  • issm/trunk-jpl/src/m/model/plot/plot_profile.m

    r12374 r12375  
    99%process model
    1010[x_m y_m z_m elements_m is2d isplanet]=processmesh(md,[],options);
    11 if ~is2d, error('only 3d model supported'); end
     11if is2d, error('only 3d model supported'); end
    1212
    1313%Get number of curves and generate random colors
     
    1616color=eval([ colorm '(numcurves);']);
    1717options=removefield(options,'colormap',0); %back to default colormap
     18
     19%Get coordinates
     20location=getfieldvalue(options,'profile');
     21if ~isnumeric(location) | numel(location)~=2,
     22        error('location provided not supported (should be [x y])');
     23end
     24xprof=location(1);
     25yprof=location(2);
    1826
    1927%Loop over number of curves
     
    3240
    3341        %Compute profile value
    34         [z,data_interp]=ProfileValues(md,data,xprof,yprof,resolution)
     42        [z,data_interp]=ProfileValues(md,data,xprof,yprof,resolution);
    3543
    3644        %plot profile
    3745        subplot(nlines,ncols,i)
    38         A=elements(:,1); B=elements(:,2); C=elements(:,3);  D=elements(:,4);
    39         plot(data_interp,z,'color',color(i,:),'LineWidth',getfieldvalue(options,'linewidth',1));
     46        plot(data_interp,z,'color',color(i,:),'LineWidth',getfieldvalue(options,'linewidth',1),'LineStyle','-');
    4047        hold on;
    4148end
     
    4552options=addfielddefault(options,'colorbar',0);
    4653options=addfielddefault(options,'ylabel','z');
     54options=addfielddefault(options,'view',2);
    4755applyoptions(md,[],options);
Note: See TracChangeset for help on using the changeset viewer.