Index: /issm/trunk-jpl/src/m/plot/applyoptions.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/applyoptions.py	(revision 21282)
+++ /issm/trunk-jpl/src/m/plot/applyoptions.py	(revision 21283)
@@ -165,6 +165,8 @@
 		options.addfielddefault('clim',lims)
 	else:
-		if len(data)>0: lims=[data.min(),data.max()]
-		else: lims=[0,1]
+		if len(data)>0: 
+			lims=[data.min(),data.max()]
+		else: 
+			lims=[0,1]
 	# }}}
 	# {{{ shading TODO
@@ -177,25 +179,13 @@
 	# }}}
 	# {{{ colormap
-	# default sequential colormap
-	defaultmap=truncate_colormap(mpl.cm.gnuplot2,0.1,0.9,128)
-	cmap=options.getfieldvalue('colormap',defaultmap)
-	if options.exist('log'):
-		norm = mpl.colors.LogNorm(vmin=lims[0], vmax=lims[1])
-	else:
-		norm = mpl.colors.Normalize(vmin=lims[0], vmax=lims[1])
-	options.addfield('colornorm',norm)
-	if options.exist('cmap_set_bad'):
-		NaNcolor=options.getfieldvalue('cmap_set_bad','w')
-		cmap.set_bad(NaNcolor,1.0)
+	if options.exist('colornorm'):
+		norm=options.getfieldvalue('colornorm')
+	if options.exist('colormap'):
+		cmap=options.getfieldvalue('colormap')
 	cbar_extend=0
 	if options.exist('cmap_set_over'):
-		over=options.getfieldvalue('cmap_set_over','0.5')
-		cmap.set_over(over)
 		cbar_extend+=1
 	if options.exist('cmap_set_under'):
-		under=options.getfieldvalue('cmap_set_under','0.5')
-		cmap.set_under(under)
 		cbar_extend+=2
-	options.addfield('colormap',cmap)
 	# }}}
 	# {{{ contours
@@ -215,5 +205,5 @@
 		elif cbar_extend==3:
 			extend='both'
-		cb = mpl.colorbar.ColorbarBase(ax.cax, cmap=cmap, norm=norm, extend=extend)
+		cb = mpl.colorbar.ColorbarBase(ax.cax,cmap=cmap, norm=norm, extend=extend)
 		if options.exist('alpha'):
 			cb.set_alpha(options.getfieldvalue('alpha'))
@@ -246,7 +236,7 @@
 		plt.sca(ax) # return to original axes control
 	# }}}
-	# {{{ expdisp
-	if options.exist('expdisp'):
-            expdisp(ax,options)
+	# {{{ expdisp TOFIX
+	# if options.exist('expdisp'):
+	# 	expdisp(ax,options)
 	# }}}
 	# {{{ area TODO
Index: /issm/trunk-jpl/src/m/plot/checkplotoptions.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/checkplotoptions.py	(revision 21282)
+++ /issm/trunk-jpl/src/m/plot/checkplotoptions.py	(revision 21283)
@@ -151,8 +151,8 @@
 	# {{{ scale ruler
 	if options.exist('scaleruler'):
-		if 'on' in options.exist('scaleruler','on'):
+		if 'on' in options.getfieldvalue('scaleruler','off'):
 			Lx=max(md.mesh.x)-min(md.mesh.x)
 			Ly=max(md.mesh.y)-min(md.mesh.y)
-			options.changefieldvalue('scaleruler',[min(md.mesh.x)+6./8.*Lx, min(md.mesh.y)+1./10.*Ly, 10**(ceil(log10(Lx)))/5, floor(Lx/100), 5])
+			options.changefieldvalue('scaleruler',[min(md.mesh.x)+6./8.*Lx, min(md.mesh.y)+1./10.*Ly, 10**(np.ceil(np.log10(Lx)))/5, np.floor(Lx/100), 5])
 	# }}}
 	# {{{ log scale
Index: /issm/trunk-jpl/src/m/plot/plot_BC.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_BC.py	(revision 21283)
+++ /issm/trunk-jpl/src/m/plot/plot_BC.py	(revision 21283)
@@ -0,0 +1,46 @@
+try:
+	import pylab as p
+except ImportError:
+	print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
+
+import numpy as np
+from processmesh import processmesh
+from applyoptions import applyoptions
+from plot_icefront import plot_icefront
+
+def plot_BC(md,options,fig,ax):
+	'''
+	PLOT_BC - plot model boundary conditions
+
+		Usage:
+			plot_BC(md,options,fig,axes)
+
+		See also: PLOTMODEL
+	'''
+	
+	#plot neuman
+	plot_icefront(md,options,fig,ax)
+	x,y,z,elements,is2d,isplanet=processmesh(md,[],options)
+	XLims=[np.min(x),np.max(x)]
+	YLims=[np.min(y),np.max(y)]
+	#plot dirichlets
+	dirichleton=options.getfieldvalue('dirichlet','on')
+	if dirichleton=='on':
+		ax.scatter(x[np.where(~np.isnan(md.stressbalance.spcvx))],
+							 y[np.where(~np.isnan(md.stressbalance.spcvx))],
+							 marker='o',c='r',s=240,label='vx Dirichlet',linewidth=0)
+		ax.scatter(x[np.where(~np.isnan(md.stressbalance.spcvy))],
+							 y[np.where(~np.isnan(md.stressbalance.spcvy))],
+							 marker='o',c='b',s=160,label='vy Dirichlet',linewidth=0)
+		ax.scatter(x[np.where(~np.isnan(md.stressbalance.spcvz))],
+							 y[np.where(~np.isnan(md.stressbalance.spcvz))],
+							 marker='o',c='y',s=80,label='vz Dirichlet',linewidth=0)
+
+		ax.set_xlim(XLims)
+		ax.set_ylim(YLims)
+	ax.legend()
+	#apply options
+	options.addfielddefault('title','Boundary conditions')
+	options.addfielddefault('colorbar','off')
+	applyoptions(md,[],options,fig,ax)
+	
Index: /issm/trunk-jpl/src/m/plot/plot_icefront.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_icefront.py	(revision 21283)
+++ /issm/trunk-jpl/src/m/plot/plot_icefront.py	(revision 21283)
@@ -0,0 +1,33 @@
+try:
+	import pylab as p
+except ImportError:
+	print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
+import numpy as np
+from processmesh import processmesh
+from applyoptions import applyoptions
+
+def plot_icefront(md,options,fig,ax):
+	#PLOT_ICEFRONT - plot segment on neumann BC
+	#
+	#   Usage:
+	#      plot_icefront(md,options,width,i)
+	#
+	#   See also: PLOTMODEL
+#process mesh and data
+	x,y,z,elements,is2d,isplanet=processmesh(md,[],options)
+	icefront=np.where(np.logical_and(np.sum(md.mask.ice_levelset[elements],1)<3,np.sum(md.mask.ice_levelset[elements],1)>-3)) 
+	onlyice=np.where(np.sum(md.mask.ice_levelset[elements],1)==-3)
+	noice=np.where(np.sum(md.mask.ice_levelset[elements],1)==3)
+
+	#plot mesh
+	ax.triplot(x,y,elements)
+
+	#highlight elements on neumann
+	colors=np.asarray([0.5 for element in elements[icefront]])
+	
+	ax.tripcolor(x,y,elements[icefront],facecolors=colors,alpha=0.5,label='elements on ice front')#,facecolor='b'
+
+	#apply options
+	options.addfielddefault('title','Neumann boundary conditions')
+	options.addfielddefault('colorbar','off')
+	applyoptions(md,[],options,fig,ax)
Index: /issm/trunk-jpl/src/m/plot/plot_manager.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_manager.py	(revision 21282)
+++ /issm/trunk-jpl/src/m/plot/plot_manager.py	(revision 21283)
@@ -7,4 +7,5 @@
 from checkplotoptions import checkplotoptions
 from plot_mesh import plot_mesh
+from plot_BC import plot_BC
 from processmesh import processmesh
 from processdata import processdata
@@ -57,11 +58,12 @@
 	# {{{ dealing with special plot (mesh for now)
 	if isinstance(data,(str,unicode)):
-		# convert string to lower case for a case-insensitive comparison
-		if data.lower()=='mesh': 
-			plot_mesh(md,options,ax)
-			applyoptions(md,[],options,fig,ax)
-			fig.delaxes(fig.axes[1]) # hack to remove colorbar after the fact
+		if data=='mesh': 
+			plot_mesh(md,options,fig,ax)
+			#fig.delaxes(fig.axes[1]) # hack to remove colorbar after the fact
 			return
-		elif data.lower()=='none':
+		elif data=='BC': 
+			plot_BC(md,options,fig,ax)
+			return
+		elif data=='none':
 			print 'no data provided to plot (TODO: write plot_none.py)'
 			applyoptions(md,[],options,fig,ax)
Index: /issm/trunk-jpl/src/m/plot/plot_mesh.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_mesh.py	(revision 21282)
+++ /issm/trunk-jpl/src/m/plot/plot_mesh.py	(revision 21283)
@@ -7,5 +7,5 @@
 from applyoptions import applyoptions
 
-def plot_mesh(md,options,ax):
+def plot_mesh(md,options,fig,ax):
 	'''
 	PLOT_MESH - plot model mesh
@@ -28,2 +28,3 @@
 	options.addfielddefault('colorbar','off')
 	options.addfielddefault('ticklabels','on')
+	applyoptions(md,[],options,fig,ax)
Index: /issm/trunk-jpl/src/m/plot/plot_quiver.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_quiver.py	(revision 21282)
+++ /issm/trunk-jpl/src/m/plot/plot_quiver.py	(revision 21283)
@@ -14,6 +14,6 @@
 		color=datanorm
 	#scaling of arrow length (giving info to change as it seems that there is no better way to work arround it)
-	scale=options.getfieldvalue('scale',scaler)
-	print('the current value for scale is {}, increase it to shorten the arrows'.format(scale))
+	scale=options.getfieldvalue('scaling',scaler)
+	print('the current value for "scaling" is {}, increase it to shorten the arrows'.format(scale))
 	#sizing of the arrows
 	width=options.getfieldvalue('width',5.0e-3)
@@ -32,4 +32,8 @@
 								angles='xy')
 	else:
+		if options.exist('colornorm'):
+			norm=options.getfieldvalue('colornorm')
+		if options.exist('colormap'):
+			cmap=options.getfieldvalue('colormap')		
 		Q=ax.quiver(x,y,vx,vy,color,cmap=cmap,norm=norm,
 								scale=scale,scale_units='xy',
Index: /issm/trunk-jpl/src/m/plot/plot_unit.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_unit.py	(revision 21282)
+++ /issm/trunk-jpl/src/m/plot/plot_unit.py	(revision 21283)
@@ -29,8 +29,8 @@
 	# {{{ define wich colormap to use 
 	try:
-		defaultmap=plt.cm.viridis
+		defaultmap=plt.cm.get_cmap('viridis',colorlevels)
 	except AttributeError:
 		print("Viridis can't be found (probably too old Matplotlib) reverting to gnuplot colormap")
-		defaultmap=truncate_colormap(mpl.cm.gnuplot2,0.1,0.9,128)
+		defaultmap=truncate_colormap('gnuplot2',0.1,0.9,colorlevels)
 	cmap=options.getfieldvalue('colormap',defaultmap)
 	if options.exist('cmap_set_over'):
@@ -40,4 +40,5 @@
 		under=options.getfieldvalue('cmap_set_under','0.5')
 		cmap.set_under(under)
+	options.addfield('colormap',cmap)
 	# }}}	
 	# {{{ Get the colormap limits
@@ -57,4 +58,9 @@
 	else:
 		norm = mpl.colors.Normalize(vmin=lims[0], vmax=lims[1])
+	if options.exist('log'):
+		norm = mpl.colors.LogNorm(vmin=lims[0], vmax=lims[1])
+	else:
+		norm = mpl.colors.Normalize(vmin=lims[0], vmax=lims[1])
+	options.addfield('colornorm',norm)
 	# }}}
 	
@@ -81,5 +87,4 @@
 				triangles=mpl.tri.Triangulation(x,y,elements)
 			ax.tricontourf(triangles,data,colorlevels,cmap=cmap,norm=norm,alpha=alpha)
-#			ax.tricontourf(triangles,data,colorlevels,cmap=cmap,norm=norm,alpha=alpha,extend='both')
 			if edgecolor != 'None':
 				ax.triplot(x,y,elements,color=edgecolor)
Index: /issm/trunk-jpl/src/m/plot/plotdoc.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plotdoc.py	(revision 21283)
+++ /issm/trunk-jpl/src/m/plot/plotdoc.py	(revision 21283)
@@ -0,0 +1,169 @@
+def plotdoc():
+	'''PLOTDOC - plot documentation
+	%As of now it is more a TODO list
+	%   Usage:
+	%      plotdoc()
+	'''
+	pydata={'quiver':' quiver plot give data and a vector array [Vx,Vy]',
+					'mesh':' draw mesh using trisurf',
+					'BC':' this will draw all the boundary conditions (Dirichlet and Neumann).'}
+	TODOdata={'basal_drag':' plot the basal drag on the bed (in kPa) based on the velocity in md.initialization',
+				'basal_dragx or basal_dragy' :' plot a component of the basal drag on the bed (in kPa)',
+				'boundaries':' this will draw all the segment boundaries to the model, including rifts.',
+				'icefront':' this will show segments that are used to define the icefront of the model (Neumann boundary conditions).',
+				'deviatoricstress_tensor':' plot the components of the deviatoric stress tensor (tauxx,tauyy,tauzz,tauxy,tauxz,tauyz, if computed',
+				'deviatoricstress_principal':' plot the deviatoricstress tensor principal axis and principal values',
+				'deviatoricstress_principalaxis1':' arrow plot the first principal axis of the deviatoricstress tensor(replace 1 by 2 or 3 if needed)',
+				'driving_stress':' plot the driving stress (in kPa)',
+				'elements_type':' model used for each element',
+				'elementnumbering':' numbering of elements',
+				'vertexnumbering':' numbering of vertices',
+				'highlightelements':' to highlight elements to highlight the element list',
+				'highlightvertices':' to highlight vertices (use highlight option to enter the vertex list',
+				'referential':' stressbalance referential',
+				'riftvel':' velocities along rifts',
+				'riftrelvel':' relative velocities along rifts',
+				'riftpenetration':' penetration levels for a fault',
+				'riftfraction':' fill fractions for every node of the rifts',
+				'rifts':' plot mesh with an offset so that rifts are visible',
+				'strainrate_tensor':' plot the components of the strainrate tensor (exx,eyy,ezz,exy,exz,eyz) if computed',
+				'strainrate_principal':' plot the strainrate tensor principal axis and principal values)',
+				'strainrate_principalaxis1':' arrow plot the first principal axis of the strainrate tensor(replace 1 by 2 or 3 if needed)',
+				'stress_tensor':' plot the components of stress tensor (sxx,syy,szz,sxy,sxz,syz) if computed',
+				'stress_principal':' plot the stress tensor principal axis and principal values',
+				'stress_principalaxis1':' arrow plot the first principal axis of the stress tensor(replace 1 by 2 or 3 if needed)',
+				'transient_results':' this will printlay all the time steps of a transient run (use steps to specify the steps requested)',
+				'transient_vel':' this will printlay the velocity for the time steps requested in ''steps'' of a transient run',
+				'transient_vel':' vel can be by any field of the transient results (vx, vy, vz, vel, temperature, melting, pressure, bed, thickness, surface)',
+				'transient_field':' dynamic plot of results. specify ''steps'' option, as fell as ''field'' (defaults are all steps, for ''Vel'' field)',
+				'transient_movie':' this will printlay the time steps of a given field of a transient run',
+				'transient_movie_field':' field to be printlayed when doing  transient_movie data printlay',
+				'transient_movie_output':' filename if output is desired for movie',
+				'transient_movie_time':' time for each image (default 2 seconds)',
+				'thermaltransient_results':' this will printlay all the time steps of a thermal transient run',
+				'qmuhistnorm':' histogram normal distribution. needs option qmudata',
+				'qmumean':' plot of mean distribution in sampling analysis with scaled response. needs option qmudata for descriptor',
+				'qmustddev':' plot of stddev distribution in sampling analysis with scaled response. needs option qmudata for descriptor',
+				'part_hist':' partitioning node and area histogram'}
+	
+	pyoptions={'axis':" show ('on') or hide ('off') axes",
+						 'caxis':" modify  colorbar range. (array of type [a b] where b>=a)",
+						 'colorlevels':" N, number of levels to use",
+						 'colorbar':" add colorbar (string 'on','off' or 'one')",
+						 'axes_pad':" spacing between axes (default is 0.25)",
+						 'colorbartitle':" colorbar title (string)",
+						 'colormap':" change the default colormap ('viridis' is the default)",
+						 'contourlevels':" N or [value1,...] add the contours of the specified values or N contours",
+						 'streamlines':" TOFIX argument does nothing",
+						 'edgecolor':" color of mesh edges. RGB tuple or standard string",
+						 'fontsize':" fontsize for the title",
+						 'fontweight':" fontweight for the title 'normal', 'bold'",
+						 'fontcolor':" TODO",
+						 'title':" subplot title (string)",
+						 'xlim':" limits of X axis (all subplots) (ex: [0,500])",
+						 'ylim':" limits of Y axis (all subplots) (ex: [0,500])",
+						 'xlabel':" X axis title",
+						 'ylabel':" Y axis title",
+						 'scaling':" scaling factor used by quiver plots.",
+						 'quivercol':" color of quiver arrows, 'values' give value colored arrows",
+						 'text':" print string or list of strings",
+						 'textposition':" [x,y] position of text, list if several texts (position betwee 0 and 1)",
+						 'textsize':" text fontsize TOFIX ",
+						 'textweight':" text fontweight",
+						 'textcolor':" text color",
+						 'textrotation':" text rotation angle",
+						 'mask':" condition. Only 'true' values are plotted ",
+						 'log':" cutoff value for log",
+						 'backgroundcolor':" plot background color. RGB tuple or standard string"}
+	TODOoptions={'basin':" zoom on a given basin ('pineislandglacier','ronneiceshelf', use isbasin to identify a basin",
+					 'figurebackgroundcolor':" figure background color. (default is 'none',",
+					 'coord':"  'xy' (default) or 'latlon'",
+					 'colorbarpos':" [x,y,dx,dy] where x,y,dx and dy are within [0 1]",
+					 'colorbarcornerposition':" 'West','North',etc ...",
+					 'colorbartitlerotation':" -90, etc ...",
+					 'colorbarfontsize':" specify colorbar fontsize",
+					 'colorbarwidth':" multiplier (default 1) to the default width colorbar",
+					 'colorbarheight':" multiplier (default 1) to the default height colorbar",
+					 'contourticks':" 'on' or 'off' to printlay the ticks of the contours",
+					 'contouronly':" 'on' or 'off' to printlay the contours on a white background",
+					 'contourcolor':" ticks and contour color",
+					 'density':" density of quivers (one arrow every N nodes, N integer)",
+					 'inset':" add an inset (zoom) of the current figure if 1 (use 'insetx', 'insety' and 'insetpos' to determine the inset position and content)",
+					 'insetx':" [min(x) max(x)] where min(x) and max(x) are values determining the inset content",
+					 'insety':" [min(y) max(y)] where min(y) and max(y) are values determining the inset content",
+					 'insetpos':" [x,y,dx,dy] where x,y,dx and dy are within [0 1]",
+					 'highlight':" highlights certain nodes or elements when using 'nodenumbering' or 'elementnumbering' or 'highlightnodes ' or 'highlightelements' option",
+					 'resolution':" resolution used by section value (array of type [horizontal_resolution vertical_resolution])",
+					 'showsection':" show section used by 'sectionvalue' (string 'on' or a number of labels)",
+					 'sectionvalue':" give the value of data on a profile given by an Argus file (string 'Argusfile_name.exp',",
+					 'profile':" give the value of data along a vertical profile ([xlocation ylocation])",
+					 'smooth':" smooth element data (string 'yes' or integer)",
+
+					 'view':" same as standard matlab option (ex: 2, 3 or [90 180]",
+					 'zlim':" same as standard matlab option",
+					 'xticklabel':" specifiy xticklabel",
+					 'yticklabel':" specifiy yticklabel",
+					 'overlay':" yes or no. This will overlay a radar amplitude image behind",
+					 'overlay_image':" path to overlay image. provide overlay_xlim, overlay_ylim, overlay_xposting and overlay_yposting options also",
+					 'contrast':" (default 1) coefficient to add contrast to the radar amplitude image used in overlays",
+					 'highres':" resolution of overlayed radar amplitude image (default is 0, high resolution is 1).",
+					 'alpha':" transparency coefficient (the higher, the more transparent). Default is 1.5",
+					 'scaling':" scaling factor used by quiver plots. Default is 0.4",
+					 'autoscale':" set to 'off' to have all the quivers with the same size. Default is 'on'",
+					 'expprint':" plot exp file on top of a data plot. provide exp file as an argument (use a cell of strings if more than one)",
+					 'expstyle':" marker style for expprint plot (use a cell of strings if more than one)",
+					 'linewidth':" line width for expprint plot (use a cell of strings if more than one)",
+					 'border':" size of printlay border (in pixels). active only for overlay plots",
+
+					 'nan':" value assigned to NaNs (convenient when plotting BC)",
+					 'partitionedges':" 'off' by default. overlay plot of partition edges",
+
+					 'latlon':" 'on' or {latstep lonstep [resolution [color]]} where latstep,longstep and resolution are in degrees, color is a [r g b] array",
+					 'latlonnumbering':" 'on' or {latgap longap colornumber latangle lonangle} where latgap and longap are pixel gaps for the numbers", 
+					 'latlonclick':" 'on' to click on latlon ticks positions colornumber is a [r g b] array and latangle and lonangle are angles to flip the numbers",
+					 'northarrow':" add an arrow pointing north, 'on' for default value or [x0 y0 length [ratio width fontsize]] where (x0,y0) are the coordinates of the base, ratio=headlength/length",
+					 'offset':" mesh offset used by 'rifts', default is 500",
+					 'scaleruler':" add a scale ruler, 'on' for default value or [x0 y0 length width numberofticks] where (x0,y0) are the coordinates of the lower left corner",
+					 'showregion':" show domain in Antarctica on an inset, use 'insetpos' properties",
+					 'visible':" 'off' to make figure unvisible, default is 'on'",
+					 'wrapping':" repeat 'n' times the colormap ('n' must be an integer)",
+					 'unit':" by default, in m, otherwise, 'km' is available",
+					 'legend_position':" by default, 'NorthEasth'",
+					 'qmudata':" ",
+					 'figposition':" position of figure: 'fullscreen', 'halfright', 'halfleft', 'portrait', 'landscape',... (hardcoded in applyoptions.m)",
+					 'offsetaxispos':" offset of current axis position to get more space (ex: [-0.02 0  0.04 0])",
+					 'axispos':" axis position to get more space",
+					 'hmin':" (numeric, minimum for histogram)",
+					 'hmax':" (numeric, maximum for histogram)",
+					 'hnint':" (numeric, number of intervals for histogram)",
+					 'ymin1':" (numeric, minimum of histogram y-axis)",
+					 'ymax1':" (numeric, maximum of histogram y-axis)",
+					 'ymin2':" (numeric, minimum of cdf y-axis)",
+					 'ymax2':" (numeric, maximum of cdf y-axis)",
+					 'cdfplt':" (char, 'off' to turn off cdf line plots)",
+					 'cdfleg':" (char, 'off' to turn off cdf legends)",
+					 'segmentnumbering':" ('off' by default)",
+					 'kmlgroundoverlay':" ('off' by default)",
+					 'kmlfilename':" ('tempfile.kml' by default)",
+					 'kmlroot':" ('./' by default)",
+					 'kmlimagename':" ('tempimage' by default)",
+					 'kmlimagetype':" ('png' by default)",
+					 'kmlresolution':" (1 by default)",
+					 'kmlfolder':" ('Ground Overlay' by default)",
+					 'kmlfolderdescription':" ('' by default)",
+					 'kmlgroundoverlayname':" ('' by default)",
+					 'kmlgroundoverlaydescription':"N/A by default')"}
+
+
+
+	print("   Plot usage: plotmodel(model,varargin)")
+	print("   plotting is done with couples of keywords values, the type and style of data to display is given by one (or several) of the followings")
+	print("   Options: ")
+	print("     'data' : and a model field or one of the following options.")
+	for key in pydata.keys():
+		print("     - {} : {}".format(key,pydata[key]))
+	print("")
+	print("   The general look of the plot is then given by the following keywords")
+	for key in pyoptions.keys():
+		print("     - {} : {}".format(key,pyoptions[key]))
+	print("       any options (except 'data') can be followed by '#i' where 'i' is the subplot number, or '#all' if applied to all plots")
Index: /issm/trunk-jpl/src/m/plot/plotmodel.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plotmodel.py	(revision 21282)
+++ /issm/trunk-jpl/src/m/plot/plotmodel.py	(revision 21283)
@@ -1,4 +1,5 @@
 import numpy as np
 from plotoptions import plotoptions
+from plotdoc import plotdoc
 
 try:
@@ -13,5 +14,5 @@
 
 def plotmodel(md,*args):
-	'''	at command prompt, type 'plotdoc' for additional documentation
+	'''	at command prompt, type 'plotdoc()' for additional documentation
 	'''
 
@@ -21,5 +22,4 @@
 	#get number of subplots
 	subplotwidth=ceil(sqrt(options.numberofplots))
-	
 	#Get figure number and number of plots
 	figurenumber=options.figurenumber
@@ -52,5 +52,4 @@
 	#Go through plots
 	if numberofplots:
-		
 		#if plt.fignum_exists(figurenumber): 
 		#	plt.cla()
@@ -64,17 +63,27 @@
 		fig.clf()
 
+		backgroundcolor=options.list[0].getfieldvalue('backgroundcolor',(0.7,0.7,0.7))
+		fig.set_facecolor(backgroundcolor)
+
+
+		translator={'on':'each',
+								'off':'None',
+								'one':'single'}
 		# options needed to define plot grid
+		plotnum=options.numberofplots
 		direction=options.list[0].getfieldvalue('direction','row') # row,column
 		axes_pad=options.list[0].getfieldvalue('axes_pad',0.25)
 		add_all=options.list[0].getfieldvalue('add_all',True) # True,False
 		share_all=options.list[0].getfieldvalue('share_all',True) # True,False
-		label_mode=options.list[0].getfieldvalue('label_mode','1') # 1,L,all
-		cbar_mode=options.list[0].getfieldvalue('cbar_mode','each') # none,single,each
-		cbar_location=options.list[0].getfieldvalue('cbar_location','right') # right,top
-		cbar_size=options.list[0].getfieldvalue('cbar_size','5%')
-		cbar_pad=options.list[0].getfieldvalue('cbar_pad','2.5%') # None or %
+		label_mode=options.list[0].getfieldvalue('label_mode','L') # 1,L,all
+		colorbar=options.list[0].getfieldvalue('colorbar','on') # on, off (single)
+		cbar_mode=translator[colorbar]
+		cbar_location=options.list[0].getfieldvalue('colorbarpos','right') # right,top
+		cbar_size=options.list[0].getfieldvalue('colorbarsize','5%')
+		cbar_pad=options.list[0].getfieldvalue('colorbarpad','2.5%') # None or %
 		
 		axgrid=ImageGrid(fig, 111,
 				nrows_ncols=(nrows,ncols),
+				ngrids=plotnum,
 				direction=direction,
 				axes_pad=axes_pad,
@@ -88,6 +97,7 @@
 				)
 
-		if cbar_mode=='none':
-			for ax in axgrid.cbar_axes: fig._axstack.remove(ax)
+		if cbar_mode=='off':
+			for ax in axgrid.cbar_axes: 
+				fig._axstack.remove(ax)
 
 		for i in xrange(numberofplots):
Index: /issm/trunk-jpl/src/m/plot/processdata.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/processdata.py	(revision 21282)
+++ /issm/trunk-jpl/src/m/plot/processdata.py	(revision 21283)
@@ -1,3 +1,2 @@
-from math import isnan
 import numpy as np
 
@@ -18,6 +17,7 @@
 	# {{{ Initialisation and grabbing auxiliaries
 	# check format
-	if (len(data)==0 or (len(data)==1 and not isinstance(data,dict) and isnan(data).all())):
+	if (len(data)==0 or (len(data)==1 and not isinstance(data,dict) and np.isnan(data).all())):
 		raise ValueError("processdata error message: 'data' provided is empty")
+	# get the shape
 	if 'numberofvertices2d' in dir(md.mesh):
 		numberofvertices2d=md.mesh.numberofvertices2d
@@ -29,12 +29,18 @@
 	#initialize datatype
 	datatype=0
-	# init patches
 	# get datasize
 	if np.ndim(procdata)==1:
-		datasize=np.array([len(procdata),1])
+		datasize=(np.shape(procdata)[0],1)
+	elif np.ndim(procdata)==2:
+		datasize=np.shape(procdata)
+	elif np.ndim(procdata)==3:
+		if np.shape(procdata)[0]==2:
+			#treating a dim two list that needs to be stacked
+			procdata=np.hstack((procdata[0,:,:],procdata[1,:,:]))
+			datasize=np.shape(procdata)
+		else:
+			raise ValueError('data list contains more than two vectore, we can not cope with that')
 	else:
-		datasize=np.shape(procdata)
-		if len(datasize)>2:
-			raise ValueError('data passed to plotmodel has more than 2 dimensions; check that column vectors are rank-1')
+		raise ValueError('data passed to plotmodel has bad dimensions; check that column vectors are rank-1')
   # }}}      
 	# {{{ process NaN's if any
@@ -66,6 +72,6 @@
 	# }}}  
 	# {{{ element data
+
 	if datasize[0]==md.mesh.numberofelements and datasize[1]==1:
-		print'ploting elements'
 		#initialize datatype if non patch
 		if datatype!=4 and datatype!=5:
@@ -85,8 +91,8 @@
 				print('plotmodel warning: mask length not supported yet (supported length are md.mesh.numberofvertices and md.mesh.numberofelements')
 		# }}}  
+
 	# }}}  
 	# {{{ node data
 	if datasize[0]==md.mesh.numberofvertices and datasize[1]==1:
-		print'ploting nodes'
 		datatype=2
 		# {{{ Mask
