Changeset 13870


Ignore:
Timestamp:
11/04/12 15:03:26 (12 years ago)
Author:
Eric.Larour
Message:

CHG: slight mods to these two routines

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

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/plot/curvedarrow.m

    r13836 r13870  
    1010%            'ratio': default .5 (ratio headarrow/length)
    1111%            'widthratio': default is 1/10 of length
     12%            'width': if you want to specify an absolute width
    1213
    1314        %recover options
    1415        options=pairoptions(varargin{:});
    1516        ratio=getfieldvalue(options,'ratio',.1);
    16         widthratio=getfieldvalue(options,'widthratio',.1);
     17        arrowlength=getfieldvalue(options,'arrowlength',1);
    1718        color=getfieldvalue(options,'color','k');
    1819
     
    2324        %compute some values out of (x1,y1) and (x2,y2)
    2425        length=distance*angle;
    25         width=length*widthratio;
     26       
     27        if exist(options,'widthratio'),
     28                widthratio=getfieldvalue(options,'widthratio');
     29                width=length*widthratio;
     30        else if exist(options,'width'),
     31                width=getfieldvalue(options,'width');
     32        else
     33                widthratio=.1;
     34                width=length*widthratio;
     35        end
    2636
    2737        %buidl the arrow itself:
     
    4151        E=D+2/3*(D-C);
    4252        F=C+2/3*(C-D);
     53
    4354        n=(F-E)/norm(F-E,2);
    4455        m=[-n(2) n(1)];
     
    4657                m=-m;
    4758        end
    48         d=(distance*angle)*ratio;
     59       
     60        if exist(options,'arrowlength'),
     61                d=arrowlength;
     62        else
     63                d=abs((distance*angle)*ratio);
     64        end
    4965       
    5066        %G is d distance from middle of E and F:
  • issm/trunk-jpl/src/m/plot/plot_riftrelvel.m

    r13836 r13870  
    7979                %if penetration is negative, plot in black, positive, plot in red;: ie: if rift is closing, black, if rift is opening, red.
    8080                if(penetration>0),
    81                         p2=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'*','MarkerSize',markersize); set(p2,'Color',[140 140 140]/255);
     81                        p2=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'.','MarkerSize',markersize); set(p2,'Color',[140 140 140]/255);
    8282                        isp2=1;
    8383                else
    84                         p1=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'k*','MarkerSize',markersize);
     84                        p1=plot(x(penaltypairs(j,1)) ,y(penaltypairs(j,1)),'k.','MarkerSize',markersize);
    8585                        isp1=1;
    8686                end
     
    8888
    8989        %point out the tips
    90         h2=plot(x(md.rifts.riftstruct(i).tips(1)),y(md.rifts.riftstruct(i).tips(1)),'g*','MarkerSize',markersize);
    91         plot(x(md.rifts.riftstruct(i).tips(2)),y(md.rifts.riftstruct(i).tips(2)),'g*','MarkerSize',markersize);
     90        h2=plot(x(md.rifts.riftstruct(i).tips(1)),y(md.rifts.riftstruct(i).tips(1)),'g.','MarkerSize',markersize);
     91        plot(x(md.rifts.riftstruct(i).tips(2)),y(md.rifts.riftstruct(i).tips(2)),'g.','MarkerSize',markersize);
    9292        segments=md.rifts.riftstruct(i).segments(:,1:2);
    9393end
Note: See TracChangeset for help on using the changeset viewer.