[20498] | 1 | Index: ../trunk-jpl/src/m/plot/plot_streamlines.py
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/src/m/plot/plot_streamlines.py (revision 19461)
|
---|
| 4 | +++ ../trunk-jpl/src/m/plot/plot_streamlines.py (revision 19462)
|
---|
| 5 | @@ -17,18 +17,20 @@
|
---|
| 6 | streamlinesvx : vx component (default md.initialization.vx)
|
---|
| 7 | streamlinesvy : vy component (default md.initialization.vy)
|
---|
| 8 | streamlinescolor: color string
|
---|
| 9 | - streamlinesdensity: density of plotted streamlines
|
---|
| 10 | + streamlinesdensity: density of plotted streamlines (default 1)
|
---|
| 11 | streamlineswidth: linewidth value or 'vel' to scale by velocity
|
---|
| 12 | streamlineswidthscale: scaling multiplier for linewidth scaled by velocity
|
---|
| 13 | + streamlinesarrowsize: size of arrows on lines (default 1)
|
---|
| 14 |
|
---|
| 15 | '''
|
---|
| 16 |
|
---|
| 17 | # retrieve options
|
---|
| 18 | vx=options.getfieldvalue('streamlinesvx',md.initialization.vx)
|
---|
| 19 | - vy=options.getfieldvalue('streamlinesvx',md.initialization.vy)
|
---|
| 20 | + vy=options.getfieldvalue('streamlinesvy',md.initialization.vy)
|
---|
| 21 | color=options.getfieldvalue('streamlinescolor','k')
|
---|
| 22 | linewidth=options.getfieldvalue('streamlineswidth',1)
|
---|
| 23 | density=options.getfieldvalue('streamlinesdensity',1)
|
---|
| 24 | + arrowsize=options.getfieldvalue('streamlinesarrowsize',1)
|
---|
| 25 |
|
---|
| 26 | #process mesh and data
|
---|
| 27 | x,y,z,elements,is2d,isplanet=processmesh(md,vx,options)
|
---|
| 28 | @@ -59,4 +61,4 @@
|
---|
| 29 | linewidth[linewidth<0.5]=0.5
|
---|
| 30 |
|
---|
| 31 | # plot streamlines
|
---|
| 32 | - ax.streamplot(xg,yg,ug,vg,color=color,linewidth=linewidth,density=density)
|
---|
| 33 | + ax.streamplot(xg,yg,ug,vg,color=color,linewidth=linewidth,density=density,arrowsize=arrowsize)
|
---|
| 34 | Index: ../trunk-jpl/src/m/plot/checkplotoptions.py
|
---|
| 35 | ===================================================================
|
---|
| 36 | --- ../trunk-jpl/src/m/plot/checkplotoptions.py (revision 19461)
|
---|
| 37 | +++ ../trunk-jpl/src/m/plot/checkplotoptions.py (revision 19462)
|
---|
| 38 | @@ -91,9 +91,9 @@
|
---|
| 39 |
|
---|
| 40 | # textweight
|
---|
| 41 | if options.exist('textweight'):
|
---|
| 42 | - textweightvalues=options.getfieldvalue('textweight')
|
---|
| 43 | + textweight=options.getfieldvalue('textweight')
|
---|
| 44 | weightlist=[]
|
---|
| 45 | - weightlist.extend(textweight if isinstance(textwieght,list) else [textweight])
|
---|
| 46 | + weightlist.extend(textweight if isinstance(textweight,list) else [textweight])
|
---|
| 47 | else:
|
---|
| 48 | weightlist=['normal']
|
---|
| 49 | if len(weightlist)==1:
|
---|
| 50 | Index: ../trunk-jpl/src/m/plot/applyoptions.py
|
---|
| 51 | ===================================================================
|
---|
| 52 | --- ../trunk-jpl/src/m/plot/applyoptions.py (revision 19461)
|
---|
| 53 | +++ ../trunk-jpl/src/m/plot/applyoptions.py (revision 19462)
|
---|
| 54 | @@ -215,39 +215,39 @@
|
---|
| 55 |
|
---|
| 56 | #colorbar {{{
|
---|
| 57 | if options.getfieldvalue('colorbar',1)==1:
|
---|
| 58 | - if cbar_extend==0:
|
---|
| 59 | - extend='neither'
|
---|
| 60 | - elif cbar_extend==1:
|
---|
| 61 | - extend='max'
|
---|
| 62 | - elif cbar_extend==2:
|
---|
| 63 | - extend='min'
|
---|
| 64 | - elif cbar_extend==3:
|
---|
| 65 | - extend='both'
|
---|
| 66 | - cb = mpl.colorbar.ColorbarBase(ax.cax, cmap=cmap, norm=norm, extend=extend)
|
---|
| 67 | - if options.exist('alpha'):
|
---|
| 68 | - cb.set_alpha(options.getfieldvalue('alpha'))
|
---|
| 69 | - if options.exist('colorbarnumticks'):
|
---|
| 70 | - cb.locator=MaxNLocator(nbins=options.getfieldvalue('colorbarnumticks',5))
|
---|
| 71 | - else:
|
---|
| 72 | - cb.locator=MaxNLocator(nbins=5) # default 5 ticks
|
---|
| 73 | - if options.exist('colorbartickspacing'):
|
---|
| 74 | - locs=npy.arange(lims[0],lims[1]+1,options.getfieldvalue('colorbartickspacing'))
|
---|
| 75 | - cb.set_ticks(locs)
|
---|
| 76 | - if options.exist('colorbarlines'):
|
---|
| 77 | - locs=npy.arange(lims[0],lims[1]+1,options.getfieldvalue('colorbarlines'))
|
---|
| 78 | - cb.add_lines(locs,['k' for i in range(len(locs))],npy.ones_like(locs))
|
---|
| 79 | - if options.exist('colorbartitle'):
|
---|
| 80 | - if options.exist('colorbartitlepad'):
|
---|
| 81 | - cb.set_label(options.getfieldvalue('colorbartitle'),\
|
---|
| 82 | - labelpad=options.getfieldvalue('colorbartitlepad'),fontsize=fontsize)
|
---|
| 83 | - else:
|
---|
| 84 | - cb.set_label(options.getfieldvalue('colorbartitle'),fontsize=fontsize)
|
---|
| 85 | - cb.ax.tick_params(labelsize=fontsize)
|
---|
| 86 | - cb.solids.set_rasterized(True)
|
---|
| 87 | - cb.update_ticks()
|
---|
| 88 | - cb.set_alpha(1)
|
---|
| 89 | - cb.draw_all()
|
---|
| 90 | - plt.sca(ax) # return to original axes control
|
---|
| 91 | + if cbar_extend==0:
|
---|
| 92 | + extend='neither'
|
---|
| 93 | + elif cbar_extend==1:
|
---|
| 94 | + extend='max'
|
---|
| 95 | + elif cbar_extend==2:
|
---|
| 96 | + extend='min'
|
---|
| 97 | + elif cbar_extend==3:
|
---|
| 98 | + extend='both'
|
---|
| 99 | + cb = mpl.colorbar.ColorbarBase(ax.cax, cmap=cmap, norm=norm, extend=extend)
|
---|
| 100 | + if options.exist('alpha'):
|
---|
| 101 | + cb.set_alpha(options.getfieldvalue('alpha'))
|
---|
| 102 | + if options.exist('colorbarnumticks'):
|
---|
| 103 | + cb.locator=MaxNLocator(nbins=options.getfieldvalue('colorbarnumticks',5))
|
---|
| 104 | + else:
|
---|
| 105 | + cb.locator=MaxNLocator(nbins=5) # default 5 ticks
|
---|
| 106 | + if options.exist('colorbartickspacing'):
|
---|
| 107 | + locs=npy.arange(lims[0],lims[1]+1,options.getfieldvalue('colorbartickspacing'))
|
---|
| 108 | + cb.set_ticks(locs)
|
---|
| 109 | + if options.exist('colorbarlines'):
|
---|
| 110 | + locs=npy.arange(lims[0],lims[1]+1,options.getfieldvalue('colorbarlines'))
|
---|
| 111 | + cb.add_lines(locs,['k' for i in range(len(locs))],npy.ones_like(locs))
|
---|
| 112 | + if options.exist('colorbartitle'):
|
---|
| 113 | + if options.exist('colorbartitlepad'):
|
---|
| 114 | + cb.set_label(options.getfieldvalue('colorbartitle'),\
|
---|
| 115 | + labelpad=options.getfieldvalue('colorbartitlepad'),fontsize=fontsize)
|
---|
| 116 | + else:
|
---|
| 117 | + cb.set_label(options.getfieldvalue('colorbartitle'),fontsize=fontsize)
|
---|
| 118 | + cb.ax.tick_params(labelsize=fontsize)
|
---|
| 119 | + cb.solids.set_rasterized(True)
|
---|
| 120 | + cb.update_ticks()
|
---|
| 121 | + cb.set_alpha(1)
|
---|
| 122 | + cb.draw_all()
|
---|
| 123 | + plt.sca(ax) # return to original axes control
|
---|
| 124 | #}}}
|
---|
| 125 |
|
---|
| 126 | #expdisp {{{
|
---|