Index: /issm/trunk-jpl/src/m/plot/applyoptions.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/applyoptions.py	(revision 13439)
+++ /issm/trunk-jpl/src/m/plot/applyoptions.py	(revision 13440)
@@ -139,5 +139,6 @@
 	#grid {{{
 	if options.exist('grid'):
-		p.grid()
+		if 'on' in options.getfieldvalue('grid','on'):
+			p.grid()
 	#}}}
 
@@ -146,5 +147,8 @@
 	#wrapping
 
-	#colorbar
+	#colorbar {{{
+	if 'on' in options.getfieldvalue('colorbar','on'):
+		p.colorbar()
+	#}}}
 
 	#area
@@ -161,7 +165,4 @@
 
 	#contours
-
-
-
 
 	#axis positions
Index: /issm/trunk-jpl/src/m/plot/plot_manager.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_manager.py	(revision 13439)
+++ /issm/trunk-jpl/src/m/plot/plot_manager.py	(revision 13440)
@@ -1,6 +1,10 @@
 from pairoptions import *
 import pylab as p
-from checkplotoptions import *
-from plot_mesh import *
+from checkplotoptions import checkplotoptions
+from plot_mesh import plot_mesh
+from processmesh import processmesh
+from processdata import processdata
+from plot_unit import plot_unit
+from applyoptions import applyoptions
 
 def plot_manager(md,options,subplotwidth,nlines,ncols,i):
@@ -25,11 +29,34 @@
 
 		# convert string to lower case for a case-insensitive comparison
-		if data.lower()=='mesh': plot_mesh(md,options,nlines,ncols,i)
+		if data.lower()=='mesh': 
+			plot_mesh(md,options,nlines,ncols,i)
+			return
 		else:
 			print "WARNING: '%s' is not implemented or is not a valid string for option 'data'" % data
 
 	#elif data in vars(md):
-	else:
-		print "'data' not a string, plotting model properties yet to be implemented..."
+	#else:
+		#print "'data' not a string, plotting model properties yet to be implemented..."
 
-	
+	#Overlay plot
+
+	#Gridded plot
+
+	#Section plot
+
+	#Profile plot
+
+	#process data and model
+	x,y,z,elements,is2d,isplanet=processmesh(md,data,options)
+	data2,datatype=processdata(md,data,options)
+
+	#standard plot
+	p.subplot(nlines,ncols,i)
+
+	#plot unit
+	plot_unit(x,y,z,elements,data2,is2d,isplanet,datatype,options)
+
+	#apply all options
+	applyoptions(md,data2,options)
+
+	#ground overlay on kml plot_unit
Index: /issm/trunk-jpl/src/m/plot/plot_mesh.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_mesh.py	(revision 13439)
+++ /issm/trunk-jpl/src/m/plot/plot_mesh.py	(revision 13440)
@@ -13,5 +13,5 @@
 	'''
 
-	x,y,z,elements,is2d=processmesh(md,[],options)
+	x,y,z,elements,is2d,isplanet=processmesh(md,[],options)
 
 	if is2d:
Index: /issm/trunk-jpl/src/m/plot/plot_unit.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_unit.py	(revision 13440)
+++ /issm/trunk-jpl/src/m/plot/plot_unit.py	(revision 13440)
@@ -0,0 +1,49 @@
+import pylab as p
+
+def plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options):
+	"""
+	PLOT_UNIT - unit plot, display data
+
+		Usage:
+			plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options)
+
+		See also: PLOTMODEL, PLOT_MANAGER
+	"""
+
+	#edgecolor
+	edgecolor=options.getfieldvalue('edgecolor','None')
+
+	#number of colorlevels for plots
+	colorlevels=options.getfieldvalue('colorlevels',256)
+
+	if datatype==1:
+		#element plot
+		if is2d:
+			p.tripcolor(x,y,elements,data,colorlevels)
+		else:
+			raise ValueError('plot_unit error: 3D element plot not supported yet')
+		return
+
+	elif datatype==2:
+		#node plot
+		if is2d:
+			p.tricontourf(x,y,elements,data,colorlevels)
+		else:
+			raise ValueError('plot_unit error: 3D node plot not supported yet')
+		return
+
+	elif datatype==3:
+		print 'plot_unit message: quiver plot not implemented yet'
+		return
+
+	elif datatype==4:
+		#P1 patch plot
+		print 'plot_unit message: P1 patch plot not implemented yet'
+		return
+
+	elif datatype==5:
+		print 'plot_unit message: P0 patch plot not implemented yet'
+		return
+
+	else:
+		raise ValueError('datatype=%d not supported' % datatype)
Index: /issm/trunk-jpl/src/m/plot/plotmodel.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plotmodel.py	(revision 13439)
+++ /issm/trunk-jpl/src/m/plot/plotmodel.py	(revision 13440)
@@ -41,5 +41,5 @@
 	#Go through plots
 	if numberofplots:
-	
+		
 		#Create figure
 		#plots will be visible by default if ipython is run in interactive mode (invoked by ipython --pylab)
@@ -52,6 +52,5 @@
 		else:
 			p.figure(figurenumber)
-
-	
+			
 		#try:
 		for i in xrange(numberofplots):
Index: /issm/trunk-jpl/src/m/plot/processdata.m
===================================================================
--- /issm/trunk-jpl/src/m/plot/processdata.m	(revision 13439)
+++ /issm/trunk-jpl/src/m/plot/processdata.m	(revision 13440)
@@ -48,8 +48,8 @@
 end
 
-%get datatype
+%get datasize
 datasize=size(data);
 
-%Process NaN if any (do not now before mask is applied)
+%Process NaN if any (do not know before mask is applied)
 if exist(options,'nan')
 	data(find(isnan(data)))=getfieldvalue(options,'nan',0);
Index: /issm/trunk-jpl/src/m/plot/processdata.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/processdata.py	(revision 13440)
+++ /issm/trunk-jpl/src/m/plot/processdata.py	(revision 13440)
@@ -0,0 +1,75 @@
+from math import isnan
+import numpy as npy
+
+def processdata(md,data,options):
+	"""
+	PROCESSDATA - process data to be plotted
+
+		datatype = 1 -> elements
+		datatype = 2 -> nodes
+		datatype = 3 -> node quivers
+		datatype = 4 -> patch
+
+		Usage:
+			data,datatype=processdata(md,data,options);
+
+		See also: PLOTMODEL, PROCESSMESH
+	"""
+
+	#check format
+	if (len(data)==0 or (len(data)==1 and not isinstance(data,dict) and isnan(data).all())):
+		raise ValueError("processdata error message: 'data' provided is empty")
+
+	#needed later on
+	if md.mesh.numberofvertices2d:
+		numberofvertices2d=md.mesh.numberofvertices2d
+		numberofelements2d=md.mesh.numberofelements2d
+	else:
+		numberofvertices2d=npy.nan
+		numberofelements2d=npy.nan
+
+	#process patch
+
+	#initialize datatype
+	datatype=0
+
+	#get datasize
+	if npy.ndim(data)==1:
+		datasize=npy.array([len(data),1])
+	else:
+		datasize=shape(data)
+	
+	#process NaN's if any
+	if options.exist('nan'):
+		data[npy.isnan(data)]=options.getfieldvalue('nan',0)
+
+	#non-patch processing 
+
+	#element data
+	if datasize[0]==md.mesh.numberofelements and datasize[1]==1:
+		
+		#initialize datatype if non patch
+		if datatype!=4 and datatype!=5:
+			datatype=1
+
+		#mask?
+
+		#log?
+
+	#node data
+	if datasize[0]==md.mesh.numberofvertices and datasize[1]==1:
+		datatype=2
+
+		#mask?
+
+		#log?
+
+	#layer projection?
+
+	#control arrow density if quiver plot
+
+	#if datatype is still zero, error out
+	if datatype==0:
+		raise ValueError("processdata error: data provided not recognized or not supported")
+	else:
+		return data, datatype
Index: /issm/trunk-jpl/src/m/plot/processmesh.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/processmesh.py	(revision 13439)
+++ /issm/trunk-jpl/src/m/plot/processmesh.py	(revision 13440)
@@ -17,5 +17,5 @@
 		raise ValueError('processmesh error: the number of elements is the same as the number of nodes')
 
-	if not data or not isinstance(data,dict):
+	if len(data)==0 or not isinstance(data,dict):
 		
 		if 'latlon' not in options.getfieldvalue('coord','xy').lower(): #convert to lower case for comparison
@@ -52,5 +52,5 @@
 				is2d=0
 		else:
-			raise ValueError('processmesh error: dim = %d not supported')
+			raise ValueError('processmesh error: dim = %d not supported' % md.mesh.dimension)
 
 		#layer projection?
@@ -58,5 +58,5 @@
 			 if 'latlon' in options.getfieldvalue('coord','xy').lower():
 				 raise ValueError('processmesh error: cannot work with 3D mesh in lat-lon coords')
-			#we modify (w/c?) the mesh temporarily to a 2D mesh from which the 3D mesh was extruded
+			#we modify the mesh temporarily to a 2D mesh from which the 3D mesh was extruded
 			 x=x2d
 			 y=y2d
@@ -65,5 +65,5 @@
 	
 	else:
-		#Process mesh for plotting (triangulation for 2D, polycollection for 3D?)
+		#Process mesh for plotting 
 		if md.mesh.dimension==2:
 			is2d=1
@@ -79,8 +79,9 @@
 		z=z*unit
 
-	##is model a member of planet class? (won't work until planet class defined)
-	#if isinstance(md,planet):
-	#	isplanet=1
-	#else:
-	#	isplanet=0
-	return x,y,z,elements,is2d
+	#is model a member of planet class? (workaround until planet class defined)
+	if md.__class__.__name__!='model':
+		isplanet=1
+	else:
+		isplanet=0
+
+	return x,y,z,elements,is2d,isplanet
