Index: trunk/tools/drawing_tools.py
===================================================================
--- trunk/tools/drawing_tools.py	(revision 931)
+++ trunk/tools/drawing_tools.py	(revision 932)
@@ -4032,38 +4032,54 @@
 
     newvals = vals.copy()
-    dv = False
+    dvx = False
     if dxv is not None:
         newdxv = dxv.copy()
+        dvx = True
+    else:
+        newdxv = None
+    dvy = False
+    if dyv is not None:
         newdyv = dyv.copy()
-        dv = True
-    else:
-        newdxv = None
+        dvy = True
+    else:
         newdyv = None
 
-    dt = False
+    dtx = False
     if dxt is not None:
         newdxt = dxt.copy()
+        dtx = True
+    else:
+        newdxt = None
+    dty = False
+    if dyt is not None:
         newdyt = dyt.copy()
-        dt = True
-    else:
-        newdxt = None
+        dty = True
+    else:
         newdyt = None
 
-    dl = False
+    dlx = False
     if dxt is not None:
         newdxl = list(dxl)
+        dlx = True
+    else:
+        newdxl = None
+    dly = False
+    if dyt is not None:
         newdyl = list(dyl)
-        dl = True
-    else:
-        newdxl = None
+        dly = True
+    else:
         newdyl = None
 
-    dT = False
+    dTx = False
     if dxt is not None:
         newdxtit = str(dxtit)
+        dTx = True
+    else:
+        newdxtit = None
+    dTy = False
+    if dyt is not None:
         newdytit = str(dytit)
-        dT = True
-    else:
-        newdxtit = None
+        dTy = True
+    else:
         newdytit = None
 
@@ -4074,20 +4090,40 @@
         if transform == 'transpose':
             newvals = np.transpose(newvals)
-            if dv:
+            if dvx and dvy:
                 copy = newdxv.copy()
                 newdxv = np.transpose(newdyv)
                 newdyv = np.transpose(copy)
-            if dt:
+            else:
+                print errormsg
+                print '  ' + fname + ": it can not be '" + transform + "' without " +\
+                  ' both dimxvals:', dxv, ' and dimyvals:', dyv, ' !!'
+                quit(-1)
+            if dtx and dtx:
                 copy = newdxt.copy()
                 newdxt = np.transpose(newdyt)
                 newdyt = np.transpose(copy)
-            if dl:
+            else:
+                print errormsg
+                print '  ' + fname + ": it can not be '" + transform + "' without " +\
+                  ' both dimxtickvals:', dxt, ' and dimytickvals:', dyt, ' !!'
+                quit(-1)
+            if dlx and dly:
                 copy = list(newdxl)
                 newdxl = list(newdyl[::-1])
                 newdyl = list(copy[::-1])
-            if dT:
+            else:
+                print errormsg
+                print '  ' + fname + ": it can not be '" + transform + "' without " +\
+                  ' both dimxlabels:', dxl, ' and dimylabels:', dyl, ' !!'
+                quit(-1)
+            if dTx and dTy:
                 copy = str(newdxtit)
                 newdxtit = str(newdytit)
                 newdytit = str(copy)
+            else:
+                print errormsg
+                print '  ' + fname + ": it can not be '" + transform + "' without " +\
+                  ' both dimx title:', dxtit, ' and dimytitle:', dytit, ' !!'
+                quit(-1)
 
         elif transform[0:4] == 'flip':
@@ -4117,4 +4153,23 @@
 
     return newvals, newdxv, newdyv, newdxt, newdyt, newdxl, newdyl, newdxtit, newdytit
+
+#mat = np.arange(15).reshape(3,5)
+#xvals = np.zeros((3,5), dtype=np.float)
+#yvals = np.zeros((3,5), dtype=np.float)
+#for i in range(5):
+#    xvals[:,i] = -1.25 + i*0.5
+#for j in range(3):
+#    yvals[j,:] = 40.25 + j*0.5
+#xticks = np.array([-1.25, -0.25, 0.25])
+#yticks = np.array([40.25, 41.25])
+#xticklab = ['1.25 W', '0.25 W', '0,25 E']
+#yticklab = ['40.25 N', '41.25 N']
+#xtit = 'Longitude'
+#ytit = 'Latitude'
+#nv, ndxv, ndyv, ndxt, ndyt, dxl, ndyl, ndxT, ndyT = transform(mat, 'transpose', \
+#      xvals, yvals, xticks, yticks, xticklab, yticklab, xtit, ytit)
+
+#print nv, ndxv, ndyv, ndxt, ndyt, dxl, ndyl, ndxT, ndyT
+#quit()
 
 def plot_2D_shadow_time(varsv,vnames,dimxv,dimyv,dimxu,dimyu,dimn,colorbar,vs,uts,   \
@@ -4606,5 +4661,5 @@
       timlab = labes at the axis time
       valu = units at the axes which is not time
-      timeu = units at the axes which is not time
+      timeu = units at the axes which is time
       axist = which is the axis time
       dimn= dimension names to plot
@@ -4638,17 +4693,28 @@
 ##    mpl.use('Agg')
 ##    import matplotlib.pyplot as plt
-    fname = 'plot_2D_shadow_contour'
+    fname = 'plot_2D_shadow_contour_time'
 
     if varsv == 'h':
         print fname + '_____________________________________________________________'
-        print plot_2D_shadow_contour.__doc__
+        print plot_2D_shadow_contour_time.__doc__
         quit()
 
     if axist == 'x':
-        dimxv = timv.copy()
-        dimyv = valv.copy()
-    else:
-        dimxv = valv.copy()
-        dimyv = timv.copy()
+        dimxv0 = timv.copy()
+        dimyv0 = valv.copy()
+        dimxt0 = list(timpos)
+        dimyt0 = None
+        dimxl0 = list(timlab)
+        dimyl0 = None
+    else:
+        dimxv0 = valv.copy()
+        dimyv0 = timv.copy()
+        dimxt0 = None
+        dimyt0 = list(timpos)
+        dimxl0 = None
+        dimyl0 = list(timlab)
+
+    varsv, dimxv, dimyv, dimxt, dimyt, dimxl, dimyl, dimxT, dimyT = transform(varsv, \
+      reva, dimxv, dimyv, dimxt, dimyt, dimxl, dimyl)
 
     if reva[0:4] == 'flip':
