Index: trunk/tools/drawing.py
===================================================================
--- trunk/tools/drawing.py	(revision 654)
+++ trunk/tools/drawing.py	(revision 655)
@@ -13,5 +13,5 @@
 ## e.g. # drawing.py -o draw_2D_shad_line -f 'mean_dtcon-pluc-pres_lat.nc,mean_dtcon-pluc-pres_lat.nc' -S 'dtcon,prc:bottom_top|-1,south_north|-1:latmean:presmean:seismic,k:-5.,5.:monthly|dtcon|&|prc:pdf:flip@y:None:True' -v 'dtconmean,prcmean'
 ## e.g. # drawing.py -f 'geo_em.d02.nc' -o draw_topo_geogrid -S '0.,3000.:None:FF_3dom d02:png:cyl,i'
-## e.g. # drawing.py -o draw_topo_geogrid_boxes -S '0.,3000.:None:FF domains:pdf:lcc,i:d01,d02,d03' -f geo_em.d01.nc,geo_em.d02.nc,geo_em.d03.nc
+## e.g. # drawing.py -o draw_topo_geogrid_boxes -S '0.,3000.:None:FF domains:pdf:lcc,i:d01,d02,d03:0' -f geo_em.d01.nc,geo_em.d02.nc,geo_em.d03.nc
 ## e.g. # drawing.py -o draw_trajectories -f 'WRF/control/trajectory.dat@-1@/home/lluis/etudes/domains/WL_HyMeX_HighRes_C/geo_em.d03.nc#XLONG_M#XLAT_M,WRF_LMDZ/wlmdza/trajectory.dat@-1@/home/lluis/etudes/domains/WL_HyMeX_C/geo_em.d01.nc#XLONG_M#XLAT_M,WRF_LMDZ/wlmdzb/trajectory.dat@-1@/home/lluis/etudes/domains/WL_HyMeX_C/geo_em.d01.nc#XLONG_M#XLAT_M,WRF_LMDZ/wlmdzb_ii/trajectory.dat@-1@/home/lluis/etudes/domains/WL_HyMeX_C/geo_em.d01.nc#XLONG_M#XLAT_M' -S '$WRF_{CRM}$,$LMDZ_{AR4.0}$,$LMDZ_{NPv3.1}$,$LMDZ_{NPv3.1b}$|None|medicane trajectories|pdf|cyl,i' -v obs/trajectory.dat,satellite,-1
 ## e.g. # drawing.py -o draw_vals_trajectories -f WRF_LMDZ/wlmdza/tevolboxtraj_T2.nc,WRF_LMDZ/wlmdzb/tevolboxtraj_T2.nc,WRF/control/tevolboxtraj_T2.nc -S 'mean:-1:$WRF_{CRM}$,$LMDZ_{AR4.0}$,$LMDZ_{NPv3.1}$@4:tas:time|($[DD]^[HH]$):exct,6,h:$%d^{%H}$:trajectory|following|mean:pdf' -v T2
@@ -1412,5 +1412,5 @@
     draw_topo_geogrid_boxes(ncfile, values)
       ncfiles= ',' list of geo_em.d[nn].nc files to use (fisrt as topographyc reference)
-      values= [minTopo],[maxTopo]:[lonlatL]:[title]:[graphic_kind]:[mapvalues]:[labels]
+      values= [minTopo],[maxTopo]:[lonlatL]:[title]:[graphic_kind]:[mapvalues]:[labels]:[legloc]
         [min/max]Topo: minimum and maximum values of topography to draw
         lonlatL: limits of longitudes and latitudes [lonmin, latmin, lonmax, latmax] or None
@@ -1428,4 +1428,8 @@
             * 'h', high
             * 'f', full
+        legloc= location of the legend (0, autmoatic)
+          1: 'upper right', 2: 'upper left', 3: 'lower left', 4: 'lower right',
+          5: 'right', 6: 'center left', 7: 'center right', 8: 'lower center',
+          9: 'upper center', 10: 'center'
         labels= labels to write in the graph
     """
@@ -1460,4 +1464,5 @@
     mapvalues = values.split(':')[4]
     labels = values.split(':')[5]
+    legloc = int(values.split(':')[6])
 
     ncfile = ncfiles.split(',')[0]
@@ -1509,5 +1514,6 @@
 
     drw.plot_topo_geogrid_boxes(topography, Xboxlines, Yboxlines, boxlabels,         \
-      objlon0, objlat0, mintopo, maxtopo, lonlatL, grtit, kindfig, mapvalues, True)
+      objlon0, objlat0, mintopo, maxtopo, lonlatL, grtit, kindfig, mapvalues, legloc,\
+      True)
 
     objdomf.close()
@@ -1695,5 +1701,5 @@
         [vartit]: name of the variable in the graph
         [title]: title of the plot ('|' for spaces)
-        [locleg]: location of the legend (-1, autmoatic)
+        [locleg]: location of the legend (0, autmoatic)
           1: 'upper right', 2: 'upper left', 3: 'lower left', 4: 'lower right',
           5: 'right', 6: 'center left', 7: 'center right', 8: 'lower center',
@@ -1824,5 +1830,5 @@
                 'l': milisecond
            [tfmt]; desired format
-        [locleg]: location of the legend (-1, autmoatic)
+        [locleg]: location of the legend (0, autmoatic)
           1: 'upper right', 2: 'upper left', 3: 'lower left', 4: 'lower right',
           5: 'right', 6: 'center left', 7: 'center right', 8: 'lower center',
@@ -1893,4 +1899,6 @@
     if points0.find(',') != -1:
         points = points0.split(',')
+        for ip in range(len(points)):
+            points[ip] = points[ip] + '-'
     elif points0 == 'None':
         points = None
@@ -1898,5 +1906,5 @@
         points = []
         for ip in range(Nfiles):
-            points.append(points0)
+            points.append(points0+'-')
 
 # Getting values
@@ -2029,11 +2037,12 @@
     timepos, timelabels = drw.CFtimes_plot(tvals, timeunit, timekind, timefmt)
 
-    if leglabels.find(',') != -1:
-      drw.plot_lines_time(dimvalues, varvalues, valuesaxis, dimtit,                  \
-        leglabels.split(','), vartit, varunits, timepos, timelabels, title, locleg,  \
-        graphk, collines, points)
-    else:
-      drw.plot_lines_time(dimvalues, varvalues, valuesaxis, dimtit,                  \
-        None, vartit, varunits, timepos, timelabels, title, locleg, graphk, collines)
+    if leglabels != 'None':
+        legvals = leglabels.split(',')
+    else:
+        legvals = None
+
+    drw.plot_lines_time(dimvalues, varvalues, valuesaxis, dimtit, legvals, vartit,   \
+      varunits, timepos, timelabels, title, locleg, graphk, collines, points)
+
     return
 
@@ -2442,5 +2451,5 @@
       [timefmt]: format of the time labels
       [title]: title of the graphic ('|' for spaces)
-      [locleg]: location of the legend (-1, autmoatic)
+      [locleg]: location of the legend (0, automatic)
         1: 'upper right', 2: 'upper left', 3: 'lower left', 4: 'lower right',
         5: 'right', 6: 'center left', 7: 'center right', 8: 'lower center',
@@ -2706,5 +2715,5 @@
       [Tint]: [Tbeg]@[Tend] or None, interval of time to plot or -1 for all the times
       [labels]: ',' separated list of labels for the legend
-      [locleg]: location of the legend (-1, autmoatic)
+      [locleg]: location of the legend (0, automatic)
         1: 'upper right', 2: 'upper left', 3: 'lower left', 4: 'lower right',
         5: 'right', 6: 'center left', 7: 'center right', 8: 'lower center',
Index: trunk/tools/drawing_tools.py
===================================================================
--- trunk/tools/drawing_tools.py	(revision 654)
+++ trunk/tools/drawing_tools.py	(revision 655)
@@ -95,4 +95,7 @@
     dateD = np.zeros((3), dtype=int)
     timeT = np.zeros((3), dtype=int)
+
+    print 'Lluis:',StringDT
+#    quit()
 
     dateD[0] = int(StringDT[0:4])
@@ -1901,4 +1904,5 @@
         Srefdate = txtunits[Ntxtunits - 2]
 
+    print 'Lluis Srefdate:',Srefdate, 'txtunits:',txtunits,'units:',units
     if not trefT == -1:
 #        print '  ' + fname + ': refdate with time!'
@@ -2452,5 +2456,5 @@
 
 def plot_TimeSeries(valtimes, vunits, tunits, hfileout, vtit, ttit, tkind, tformat,  \
-  tit, linesn, lloc, kfig):
+  tit, linesn, lloc, kfig,coll,ptl):
     """ Function to draw time-series
       valtimes= list of arrays to plot [vals1[1values, 1times], [...,valsM[Mvals,Mtimes]]) 
@@ -2469,9 +2473,13 @@
       tit= title of the graph
       linesn= list of values fot the legend
-      lloc= location of the legend (-1, autmoatic)
+      lloc= location of the legend (0, autmoatic)
         1: 'upper right', 2: 'upper left', 3: 'lower left', 4: 'lower right',
         5: 'right', 6: 'center left', 7: 'center right', 8: 'lower center',
         9: 'upper center', 10: 'center'
       kfig= type of figure: jpg, png, pds, ps
+      coll= ',' list of colors for the lines, None for automatic, single
+          value all the same
+      ptl= ',' list of type of points for the lines, None for automatic, single
+          value all the same
     """
     fname = 'plot_TimeSeries'
@@ -2482,9 +2490,18 @@
         quit()
 
-
+    Nlines = len(linesn)
 # Canging line kinds every 7 lines (end of standard colors)
-    linekinds=['.-','x-','o-']
-
-    Nlines = len(valtimes)
+    linekinds = []
+    if ptl is None:
+        linekindsauto=['.-','x-','o-']
+        for ptype in range(4):
+            for ip in range(7):
+                linekinds.append(linekindsauto[ptype])
+    else:
+        if len(ptl) > 1:
+            linekinds = ptl
+        else:
+            for il in range(Nlines):
+                linekinds.append(ptl+'-')
 
     Nvalues = []
@@ -2522,4 +2539,5 @@
             if vmin < ymin: ymin = vmin
             if vmax > ymax: ymax = vmax
+        print il,'Lluis: ymin;',ymin,'ymax;',ymax
 
     dx = np.max(Ntimes)
@@ -2543,9 +2561,14 @@
         if vtit == 'ps':
             array[0,:] = np.where(array[0,:] < 98000., None, array[0,:])
-        plt.plot(array[1,:],array[0,:], linekinds[N7lines], label= linesn[il])
-        if il == 6: N7lines = N7lines + 1
+
+        if coll is None:
+            plt.plot(array[1,:],array[0,:], linekinds[il], label= linesn[il])
+        else:
+            plt.plot(array[1,:],array[0,:], linekinds[il], label= linesn[il],   \
+              color=coll[il])
 
     timevals = np.arange(xmin,xmax)*1.
 
+    print 'Lluis tunits:',tunits
     tpos, tlabels = CFtimes_plot(timevals, tunits, tkind, tformat)
 
@@ -3309,5 +3332,5 @@
 
 def plot_topo_geogrid_boxes(varv, boxesX, boxesY, boxlabels, olon, olat, mint, maxt, \
-  lonlatLims, gtit, kfig, mapv, closeif):
+  lonlatLims, gtit, kfig, mapv, gloc, closeif):
     """ plotting geo_em.d[nn].nc topography from WPS files
     plot_topo_geogrid(domf, mint, maxt, gtit, kfig, mapv)
@@ -3331,4 +3354,8 @@
           * 'h', high
           * 'f', full
+      gloc= location of the legend (0, autmoatic)
+        1: 'upper right', 2: 'upper left', 3: 'lower left', 4: 'lower right',
+        5: 'right', 6: 'center left', 7: 'center right', 8: 'lower center',
+        9: 'upper center', 10: 'center'
       closeif= Boolean value if the figure has to be closed
     """
@@ -3454,5 +3481,5 @@
 
     plt.title(graphtit)
-    plt.legend(loc=0)
+    plt.legend(loc=gloc)
     
     output_kind(kfig, figname, closeif)
@@ -5195,5 +5222,5 @@
       vunit= units of the vaxis
       gtit= main title
-      gloc= location of the legend (-1, autmoatic)
+      gloc= location of the legend (0, autmoatic)
         1: 'upper right', 2: 'upper left', 3: 'lower left', 4: 'lower right',
         5: 'right', 6: 'center left', 7: 'center right', 8: 'lower center',
@@ -5280,5 +5307,5 @@
       tlabs= labels of the time ticks
       gtit= main title
-      gloc= location of the legend (-1, autmoatic)
+      gloc= location of the legend (0, autmoatic)
         1: 'upper right', 2: 'upper left', 3: 'lower left', 4: 'lower right',
         5: 'right', 6: 'center left', 7: 'center right', 8: 'lower center',
