Index: /trunk/UTIL/PYTHON/myplot.py
===================================================================
--- /trunk/UTIL/PYTHON/myplot.py	(revision 637)
+++ /trunk/UTIL/PYTHON/myplot.py	(revision 638)
@@ -329,5 +329,6 @@
         subv = 2
         subh = 3
-        fig.subplots_adjust(wspace = 0.4, hspace = 0.0)
+        #fig.subplots_adjust(wspace = 0.4, hspace = 0.0)
+        fig.subplots_adjust(wspace = 0.5, hspace = 0.3)
         rcParams['font.size'] = int( rcParams['font.size'] * 1. / 2. )
     elif numplot <= 8:
@@ -651,6 +652,8 @@
     import  matplotlib.pyplot               as plt
     import  numpy                           as np
-    posx = np.min(x) - np.std(x) / 10.
-    posy = np.min(y) - np.std(y) / 10.
+    #posx = np.min(x) - np.std(x) / 10.
+    #posy = np.min(y) - np.std(y) / 10.
+    posx = np.min(x) 
+    posy = np.min(y) - 4.*np.std(y) / 10.
     u = smooth(u,csmooth)
     v = smooth(v,csmooth)
@@ -1268,2 +1271,46 @@
 #      return error 
 
+## Author : AS
+def maplatlon( lon,lat,field,\
+               proj="cyl",colorb="jet",ndiv=10,zeback="molabw",trans=0.6,title="",\
+               vecx=None,vecy=None,stride=2 ):
+    ### an easy way to map a field over lat/lon grid
+    import numpy as np
+    import matplotlib.pyplot as mpl
+    from matplotlib.cm import get_cmap
+    ## get lon and lat in 2D version. get lat/lon intervals
+    numdim = len(np.array(lon).shape)
+    if numdim == 2: 	[lon2d,lat2d] = [lon,lat]
+    elif numdim == 1:	[lon2d,lat2d] = np.meshgrid(lon,lat)
+    else:               errormess("lon and lat arrays must be 1D or 2D")
+    [wlon,wlat] = latinterv()
+    ## define projection and background. define x and y given the projection
+    m = define_proj(proj,wlon,wlat,back=zeback,blat=None,blon=None)
+    x, y = m(lon2d, lat2d)
+    ## define field. bound field.
+    what_I_plot = np.transpose(field)
+    zevmin, zevmax = calculate_bounds(what_I_plot)  ## vmin=min(what_I_plot_frame), vmax=max(what_I_plot_frame))
+    what_I_plot = bounds(what_I_plot,zevmin,zevmax)
+    ## define contour field levels. define color palette
+    ticks = ndiv + 1
+    zelevels = np.linspace(zevmin,zevmax,ticks)
+    palette = get_cmap(name=colorb)
+    ## contour field
+    m.contourf( x, y, what_I_plot, zelevels, cmap = palette, alpha = trans )
+    ## draw colorbar
+    if proj in ['moll','cyl']:        zeorientation="horizontal" ; zepad = 0.07
+    else:                             zeorientation="vertical" ; zepad = 0.03
+    #daformat = fmtvar(fvar.upper())
+    daformat = "%.0f"
+    zecb = mpl.colorbar( fraction=0.05,pad=zepad,format=daformat,orientation=zeorientation,\
+                 ticks=np.linspace(zevmin,zevmax,num=min([ticks/2+1,21])),extend='neither',spacing='proportional' ) 
+    ## give a title
+    if zeorientation == "horizontal": zecb.ax.set_xlabel(title)
+    else:                             ptitle(title)
+    ## draw vector
+    if vecx is not None and vecy is not None:
+       [vecx_frame,vecy_frame] = m.rotate_vector( np.transpose(vecx), np.transpose(vecy), lon2d, lat2d ) ## for metwinds
+       vectorfield(vecx_frame, vecy_frame, x, y, stride=stride, csmooth=2,\
+                                             scale=30., factor=500., color=definecolorvec(colorb), key=True)
+    ## scale regle la reference du vecteur. factor regle toutes les longueurs (dont la reference). l'AUGMENTER pour raccourcir les vecteurs.
+    return
Index: /trunk/UTIL/PYTHON/planetoplot.py
===================================================================
--- /trunk/UTIL/PYTHON/planetoplot.py	(revision 637)
+++ /trunk/UTIL/PYTHON/planetoplot.py	(revision 638)
@@ -566,6 +566,6 @@
                                 key = False
                             if metwind and mapmode == 1:   [vecx_frame,vecy_frame] = m.rotate_vector(vecx_frame, vecy_frame, lon2d, lat2d)
-                            if var:       colorvec = definecolorvec(back)
-                            else:         colorvec = definecolorvec(colorb)
+                            if var:       colorvec = definecolorvec(colorb) 
+                            else:         colorvec = definecolorvec(back) 
                             vectorfield(vecx_frame, vecy_frame, x, y, stride=stride, csmooth=2,\
                                              #scale=15., factor=300., color=colorvec, key=key)
