source:
issm/oecreview/Archive/19101-20495/ISSM-19461-19462.diff@
20498
Last change on this file since 20498 was 20498, checked in by , 9 years ago | |
---|---|
File size: 5.4 KB |
-
../trunk-jpl/src/m/plot/plot_streamlines.py
17 17 streamlinesvx : vx component (default md.initialization.vx) 18 18 streamlinesvy : vy component (default md.initialization.vy) 19 19 streamlinescolor: color string 20 streamlinesdensity: density of plotted streamlines 20 streamlinesdensity: density of plotted streamlines (default 1) 21 21 streamlineswidth: linewidth value or 'vel' to scale by velocity 22 22 streamlineswidthscale: scaling multiplier for linewidth scaled by velocity 23 streamlinesarrowsize: size of arrows on lines (default 1) 23 24 24 25 ''' 25 26 26 27 # retrieve options 27 28 vx=options.getfieldvalue('streamlinesvx',md.initialization.vx) 28 vy=options.getfieldvalue('streamlinesv x',md.initialization.vy)29 vy=options.getfieldvalue('streamlinesvy',md.initialization.vy) 29 30 color=options.getfieldvalue('streamlinescolor','k') 30 31 linewidth=options.getfieldvalue('streamlineswidth',1) 31 32 density=options.getfieldvalue('streamlinesdensity',1) 33 arrowsize=options.getfieldvalue('streamlinesarrowsize',1) 32 34 33 35 #process mesh and data 34 36 x,y,z,elements,is2d,isplanet=processmesh(md,vx,options) … … 59 61 linewidth[linewidth<0.5]=0.5 60 62 61 63 # plot streamlines 62 ax.streamplot(xg,yg,ug,vg,color=color,linewidth=linewidth,density=density )64 ax.streamplot(xg,yg,ug,vg,color=color,linewidth=linewidth,density=density,arrowsize=arrowsize) -
../trunk-jpl/src/m/plot/checkplotoptions.py
91 91 92 92 # textweight 93 93 if options.exist('textweight'): 94 textweight values=options.getfieldvalue('textweight')94 textweight=options.getfieldvalue('textweight') 95 95 weightlist=[] 96 weightlist.extend(textweight if isinstance(textw ieght,list) else [textweight])96 weightlist.extend(textweight if isinstance(textweight,list) else [textweight]) 97 97 else: 98 98 weightlist=['normal'] 99 99 if len(weightlist)==1: -
../trunk-jpl/src/m/plot/applyoptions.py
215 215 216 216 #colorbar {{{ 217 217 if options.getfieldvalue('colorbar',1)==1: 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 218 if cbar_extend==0: 219 extend='neither' 220 elif cbar_extend==1: 221 extend='max' 222 elif cbar_extend==2: 223 extend='min' 224 elif cbar_extend==3: 225 extend='both' 226 cb = mpl.colorbar.ColorbarBase(ax.cax, cmap=cmap, norm=norm, extend=extend) 227 if options.exist('alpha'): 228 cb.set_alpha(options.getfieldvalue('alpha')) 229 if options.exist('colorbarnumticks'): 230 cb.locator=MaxNLocator(nbins=options.getfieldvalue('colorbarnumticks',5)) 231 else: 232 cb.locator=MaxNLocator(nbins=5) # default 5 ticks 233 if options.exist('colorbartickspacing'): 234 locs=npy.arange(lims[0],lims[1]+1,options.getfieldvalue('colorbartickspacing')) 235 cb.set_ticks(locs) 236 if options.exist('colorbarlines'): 237 locs=npy.arange(lims[0],lims[1]+1,options.getfieldvalue('colorbarlines')) 238 cb.add_lines(locs,['k' for i in range(len(locs))],npy.ones_like(locs)) 239 if options.exist('colorbartitle'): 240 if options.exist('colorbartitlepad'): 241 cb.set_label(options.getfieldvalue('colorbartitle'),\ 242 labelpad=options.getfieldvalue('colorbartitlepad'),fontsize=fontsize) 243 else: 244 cb.set_label(options.getfieldvalue('colorbartitle'),fontsize=fontsize) 245 cb.ax.tick_params(labelsize=fontsize) 246 cb.solids.set_rasterized(True) 247 cb.update_ticks() 248 cb.set_alpha(1) 249 cb.draw_all() 250 plt.sca(ax) # return to original axes control 251 251 #}}} 252 252 253 253 #expdisp {{{
Note:
See TracBrowser
for help on using the repository browser.