Index: /issm/trunk-jpl/src/m/plot/plot_quiver.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_quiver.py	(revision 21256)
+++ /issm/trunk-jpl/src/m/plot/plot_quiver.py	(revision 21256)
@@ -0,0 +1,38 @@
+import numpy as np
+
+def plot_quiver(x,y,data,options,ax):
+	vx=data[:,0]
+	vy=data[:,1]
+	Xdist=max(x)-min(x)
+	Ydist=max(y)-min(y)
+	datanorm=np.sqrt(vx**2+vy**2)
+	scaler=max(datanorm)/(np.sqrt(Xdist*Ydist/len(x)))
+
+	#define colors, unicolor or value codded
+	color=options.getfieldvalue('quivercol','k')
+	if color=='values':
+		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))
+	#sizing of the arrows
+	width=options.getfieldvalue('width',5.0e-3)
+	headwidth=options.getfieldvalue('headwidth',6)
+	headlength=options.getfieldvalue('headlength',headwidth)
+	#set the unit to the smaller of the two axes
+	if Xdist>Ydist:
+		units='height'
+	else:
+		units='width'
+		
+	if type(color)==str:
+		Q=ax.quiver(x,y,vx,vy,color=color,
+								scale=scale,scale_units='xy',
+								units=units,headwidth=headwidth,headlength=headlength,width=width,
+								angles='xy')
+	else:
+		Q=ax.quiver(x,y,vx,vy,color,cmap=cmap,norm=norm,
+								scale=scale,scale_units='xy',
+								units=units,headwidth=headwidth,headlength=headlength,width=width,
+								angles='xy')
+	return Q
Index: /issm/trunk-jpl/src/m/plot/plot_unit.py
===================================================================
--- /issm/trunk-jpl/src/m/plot/plot_unit.py	(revision 21255)
+++ /issm/trunk-jpl/src/m/plot/plot_unit.py	(revision 21256)
@@ -1,3 +1,4 @@
 from cmaptools import truncate_colormap
+from plot_quiver import plot_quiver
 try:
 	import pylab as p
@@ -89,15 +90,10 @@
 	# {{{ plotting quiver (TODO)
 	elif datatype==3:
-		vx=data[:,0]
-		vy=data[:,1]
-		#TODO write plot_quiver.py to handle this here
-		color=np.sqrt(vx**2+vy**2)
-		scale=options.getfieldvalue('scale',1000)
-		width=options.getfieldvalue('width',0.005*(np.amax(x)-np.amin(y)))
-		headwidth=options.getfieldvalue('headwidth',3)
-		headlength=options.getfieldvalue('headlength',5)
-		Q=ax.quiver(x,y,vx,vy,color,cmap=cmap,norm=norm,scale=scale,
-							width=width,headwidth=headwidth,headlength=headlength)
+		if is2d:
+			Q=plot_quiver(x,y,data,options,ax)
+		else:
+			raise ValueError('plot_unit error: 3D node plot not supported yet')
 		return
+	
 	# }}}
 	# {{{ plotting P1 Patch (TODO)
