Changeset 21256


Ignore:
Timestamp:
10/11/16 07:24:53 (8 years ago)
Author:
bdef
Message:

NEW:adding quiver to py plotmodel

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

Legend:

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

    r21253 r21256  
    11from cmaptools import truncate_colormap
     2from plot_quiver import plot_quiver
    23try:
    34        import pylab as p
     
    8990        # {{{ plotting quiver (TODO)
    9091        elif datatype==3:
    91                 vx=data[:,0]
    92                 vy=data[:,1]
    93                 #TODO write plot_quiver.py to handle this here
    94                 color=np.sqrt(vx**2+vy**2)
    95                 scale=options.getfieldvalue('scale',1000)
    96                 width=options.getfieldvalue('width',0.005*(np.amax(x)-np.amin(y)))
    97                 headwidth=options.getfieldvalue('headwidth',3)
    98                 headlength=options.getfieldvalue('headlength',5)
    99                 Q=ax.quiver(x,y,vx,vy,color,cmap=cmap,norm=norm,scale=scale,
    100                                                         width=width,headwidth=headwidth,headlength=headlength)
     92                if is2d:
     93                        Q=plot_quiver(x,y,data,options,ax)
     94                else:
     95                        raise ValueError('plot_unit error: 3D node plot not supported yet')
    10196                return
     97       
    10298        # }}}
    10399        # {{{ plotting P1 Patch (TODO)
Note: See TracChangeset for help on using the changeset viewer.