Index: trunk/UTIL/PYTHON/planetoplot.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot.py	(revision 457)
+++ trunk/UTIL/PYTHON/planetoplot.py	(revision 458)
@@ -72,5 +72,5 @@
     from mymath import deg,max,min,mean,get_tsat,writeascii,fig2data,fig2img
     import matplotlib as mpl
-    from matplotlib.pyplot import contour,contourf, subplot, figure, rcParams, savefig, colorbar, pcolor, show, plot, clabel, title, close
+    from matplotlib.pyplot import contour,contourf, subplot, figure, rcParams, savefig, colorbar, pcolor, show, plot, clabel, title, close, legend
     from matplotlib.cm import get_cmap
     import numpy as np
@@ -154,4 +154,5 @@
           vert = nc.variables["altitude"][:]
       elif typefile in ['meso','mesoapi','geo','mesoideal']:
+          ### the following lines are kind of dirty... not possible to ask for several lats and lons
           if vlon is not None or vlat is not None:   indices = bidimfind(lon2d,lat2d,vlon,vlat) ; print '********** INDICES: ', indices
           if slon is not None: slon[0][0] = indices[0] ; slon[0][1] = indices[0]
@@ -254,13 +255,7 @@
     print "********************************************"
     while error is False:
-       print "********** NPLOT", nplot
-      
-       ### General plot settings
+     
+       print "********** NPLOT", nplot 
        if nplot > numplot: break
-       if numplot > 1:  subplot(subv,subh,nplot)
-
-       ### Map projection                    
-       if mapmode == 1:     m = define_proj(proj,wlon,wlat,back=back,blat=blat,blon=blon) ; x, y = m(lon2d, lat2d)
-       elif mapmode ==0:    m = None ; x = None ; y = None
 
        ####################################################################
@@ -301,4 +296,11 @@
            vecy, error = reducefield( all_windv[index_f], d4=indextime, d3=indexvert, yint=yintegral, alt=vert)
        ####################################################################
+       ### General plot settings
+       changesubplot = (numplot > 1) and (len(what_I_plot.shape) != 1)  ## default for 1D plots: superimposed. to be reworked for better flexibility.
+       if changesubplot: subplot(subv,subh,nplot)
+       ### Map projection                    
+       if mapmode == 1:     m = define_proj(proj,wlon,wlat,back=back,blat=blat,blon=blon) ; x, y = m(lon2d, lat2d)
+       elif mapmode ==0:    m = None ; x = None ; y = None
+       ####################################################################
 
        if not error:
@@ -371,6 +373,6 @@
                             elif mapmode == 0:     contourf( x, y, what_I_plot_frame, zelevels, cmap = palette, alpha=trans)
                         else:
-                            if mapmode == 1:       m.pcolor( x, y, what_I_plot_frame, cmap = palette, vmin=zevmin, vmax=zevmax ,alpha=trans)
-                            elif mapmode == 0:     pcolor( x, y, what_I_plot_frame, cmap = palette, vmin=zevmin, vmax=zevmax ,alpha=trans)
+                            if mapmode == 1:       m.pcolor( x, y, what_I_plot_frame, cmap = palette, vmin=zevmin, vmax=zevmax, alpha=trans)
+                            elif mapmode == 0:     pcolor( x, y, what_I_plot_frame, cmap = palette, vmin=zevmin, vmax=zevmax, alpha=trans)
                         if colorb != 'nobar':        
                             if (fileref is not None) and (index_f is numplot-1):   daformat = "%.3f"
@@ -432,5 +434,13 @@
                ##### 1D field
                elif len(what_I_plot.shape) is 1:
-                 plot(x,what_I_plot)
+                 lbl = ""
+                 if indexlat is not None:  lbl = lbl + " ix" + str(indexlat)
+                 if indexlon is not None:  lbl = lbl + " iy" + str(indexlon)
+                 if indexvert is not None: lbl = lbl + " iz" + str(indexvert)
+                 if indextime is not None: lbl = lbl + " it" + str(indextime)
+
+                 if indexvert is not None:    plot(x,what_I_plot,label=lbl)  ## regular plot
+                 else:                        plot(what_I_plot,x,label=lbl)  ## vertical profile
+                 legend(loc='best')
                  if save == 'txt':  writeascii(np.transpose(what_I_plot),'profile'+str(nplot)+'.txt')
 
