Changeset 21276
- Timestamp:
- 10/15/16 14:33:24 (8 years ago)
- Location:
- issm/trunk-jpl/src/m
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/exp/expdisp.py
r21254 r21276 2 2 import numpy as np 3 3 4 def expdisp( domainoutline,ax,linestyle='--k',linewidth=1,unitmultiplier=1.):4 def expdisp(ax,options): 5 5 ''' 6 6 plot the contents of a domain outline file 7 7 8 This routine reads in a domain outline file and plots all of the x,y contours8 This routine reads in an exp file and plots all of the x,y points/lines/patches 9 9 10 'ax' is a handle to the current plot axes, onto which the contours are to be drawn10 'ax' is a handle to the current plot axes, onto which we want to plot 11 11 12 12 Usage: … … 17 17 ''' 18 18 19 domain=expread(domainoutline) 19 filename=options.getfieldvalue('expdisp') 20 style=options.getfieldvalue('expstyle','k') 21 linewidth=options.getfieldvalue('explinewidth',1) 22 unitmultiplier=options.getfieldvalue('unit',1) 23 for i in xrange(len(filename)): 24 filenamei=filename[i] 25 stylei=style[i] 26 if type(linewidth)==list: 27 linewidthi=linewidth[i] 28 else: 29 linewidthi=linewidth 20 30 21 for i in xrange(len(domain)): 22 if domain[i]['nods']==1: 23 ax.plot(domain[i]['x']*unitmultiplier,domain[i]['y']*unitmultiplier,'o',mec='k',mfc='r',ms=10) 24 else: 25 x=domain[i]['x'].tolist() # since expread returns a string representation of the arrays 26 y=domain[i]['y'].tolist() 27 ax.plot(x*unitmultiplier,y*unitmultiplier,linestyle,linewidth=linewidth) 31 domain=expread(filenamei) 32 for i in xrange(len(domain)): 33 if domain[i]['nods']==1: 34 ax.plot(domain[i]['x']*unitmultiplier,domain[i]['y']*unitmultiplier,'o',mec='k',mfc='r',ms=10) 35 else: 36 x=domain[i]['x'].tolist() # since expread returns a string representation of the arrays 37 y=domain[i]['y'].tolist() 38 ax.plot(x*unitmultiplier,y*unitmultiplier,stylei,linewidth=linewidthi) -
issm/trunk-jpl/src/m/plot/applyoptions.py
r21254 r21276 248 248 # {{{ expdisp 249 249 if options.exist('expdisp'): 250 filename=options.getfieldvalue('expdisp') 251 style=options.getfieldvalue('expstyle','k') 252 linewidth=options.getfieldvalue('explinewidth',1) 253 for i in xrange(len(filename)): 254 filenamei=filename[i] 255 stylei=style[i] 256 if type(linewidth)==list: 257 linewidthi=linewidth[i] 258 else: 259 linewidthi=linewidth 260 expdisp(filenamei,ax,linestyle=stylei,linewidth=linewidthi,unitmultiplier=options.getfieldvalue('unit',1)) 250 expdisp(ax,options) 261 251 # }}} 262 252 # {{{ area TODO
Note:
See TracChangeset
for help on using the changeset viewer.