Changeset 21588
- Timestamp:
- 03/06/17 02:07:37 (8 years ago)
- Location:
- issm/trunk-jpl/src/m/plot
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/plot/plot_BC.py
r21303 r21588 8 8 from applyoptions import applyoptions 9 9 from plot_icefront import plot_icefront 10 from mpl_toolkits.mplot3d import Axes3D 10 11 11 def plot_BC(md,options,fig,ax ):12 def plot_BC(md,options,fig,axgrid,gridindex): 12 13 ''' 13 14 PLOT_BC - plot model boundary conditions … … 18 19 See also: PLOTMODEL 19 20 ''' 21 x,y,z,elements,is2d,isplanet=processmesh(md,[],options) 20 22 23 ax=axgrid[gridindex] 24 fig.delaxes(axgrid.cbar_axes[gridindex]) 25 26 if not is2d: 27 ax=inset_locator.inset_axes(axgrid[gridindex],width='100%',height='100%',loc=3,borderpad=0,axes_class=Axes3D) 28 21 29 #plot neuman 22 30 plot_icefront(md,options,fig,ax) 23 x,y,z,elements,is2d,isplanet=processmesh(md,[],options) 31 24 32 XLims=[np.min(x),np.max(x)] 25 33 YLims=[np.min(y),np.max(y)] … … 36 44 y[np.where(~np.isnan(md.stressbalance.spcvz))], 37 45 marker='o',c='y',s=80,label='vz Dirichlet',linewidth=0) 38 46 ax.scatter(x[np.where(~np.isnan(md.hydrology.spcepl_head))], 47 y[np.where(~np.isnan(md.hydrology.spcepl_head))], 48 marker='v',c='r',s=240,label='EPL Head',linewidth=0) 49 ax.scatter(x[np.where(~np.isnan(md.hydrology.spcsediment_head))], 50 y[np.where(~np.isnan(md.hydrology.spcsediment_head))], 51 marker='^',c='b',s=240,label='IDS head',linewidth=0) 52 39 53 ax.set_xlim(XLims) 40 54 ax.set_ylim(YLims) 41 ax.legend() 55 ax.legend(bbox_to_anchor=(0., 1.02, 1., .102), loc=3, 56 ncol=3, mode="expand", borderaxespad=0.) 42 57 #apply options 43 58 options.addfielddefault('title','Boundary conditions') 44 59 options.addfielddefault('colorbar','off') 45 applyoptions(md,[],options,fig,ax )60 applyoptions(md,[],options,fig,axgrid,gridindex) 46 61 -
issm/trunk-jpl/src/m/plot/plot_icefront.py
r21303 r21588 16 16 #process mesh and data 17 17 x,y,z,elements,is2d,isplanet=processmesh(md,[],options) 18 icefront=np.where(np.logical_and(np.sum(md.mask.ice_levelset[elements],1)<3,np.sum(md.mask.ice_levelset[elements],1)>-3)) 18 19 #icefront check 20 icefront=np.where(np.abs(np.sum(md.mask.ice_levelset[elements],1))!=3) 19 21 onlyice=np.where(np.sum(md.mask.ice_levelset[elements],1)==-3) 20 22 noice=np.where(np.sum(md.mask.ice_levelset[elements],1)==3) 21 23 24 #hydro neumann 25 hydro_neumann=np.where(md.hydrology.neumannflux!=0) 22 26 #plot mesh 23 27 ax.triplot(x,y,elements) 24 28 25 29 #highlight elements on neumann 26 colors=np.asarray([0.5 for element in elements[icefront]]) 27 28 ax.tripcolor(x,y,elements[icefront],facecolors=colors,alpha=0.5,label='elements on ice front')#,facecolor='b' 30 if len(icefront[0])>0: 31 colors=np.asarray([0.5 for element in elements[icefront]]) 32 ax.tripcolor(x,y,elements[icefront],facecolors=colors,alpha=0.5,label='elements on ice front') 33 if len(hydro_neumann[0])>0: 34 colors=np.asarray([0.5 for element in elements[hydro_neumann]]) 35 ax.tripcolor(x,y,elements[hydro_neumann],facecolors=colors,alpha=0.5,label='non zero neumann flux for the hydrology') 29 36 30 37 #apply options 31 38 options.addfielddefault('title','Neumann boundary conditions') 32 39 options.addfielddefault('colorbar','off') 33 applyoptions(md,[],options,fig,ax) -
issm/trunk-jpl/src/m/plot/plot_mesh.py
r21475 r21588 3 3 except ImportError: 4 4 print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled" 5 5 6 import numpy as np 6 import matplotlib as mpl7 7 from processmesh import processmesh 8 8 from applyoptions import applyoptions 9 from matplotlib.patches import Polygon10 9 from mpl_toolkits.mplot3d.art3d import Line3DCollection 11 10 from mpl_toolkits.axes_grid1 import inset_locator … … 29 28 else: 30 29 ax=inset_locator.inset_axes(axgrid[gridindex],width='100%',height='100%',loc=3,borderpad=0,axes_class=Axes3D) 31 32 30 33 31 AB=elements[:,0:2]
Note:
See TracChangeset
for help on using the changeset viewer.