Index: trunk/UTIL/PYTHON/planetoplot_v2/examples/les_psfc.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/examples/les_psfc.py	(revision 972)
+++ trunk/UTIL/PYTHON/planetoplot_v2/examples/les_psfc.py	(revision 977)
@@ -2,5 +2,5 @@
 from ppclass import pp
 
-les = pp(file="/home/aymeric/Big_Data/psfc_f18.nc",var="PSFC",y=["50,250"],x=["50","100"])
+les = pp(file="/home/aymeric/Big_Data/LES_dd/psfc_f18.nc",var="PSFC",y=["50,250"],x=["50","100"])
 les.verbose = True
 les.getplot()
Index: trunk/UTIL/PYTHON/planetoplot_v2/examples/meso_profile.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/examples/meso_profile.py	(revision 972)
+++ trunk/UTIL/PYTHON/planetoplot_v2/examples/meso_profile.py	(revision 977)
@@ -11,5 +11,5 @@
 m.y = -5. # setting a fixed y value
 m.z = None # leaving z as a free dimension
-m.t = [6.,12.,18.,24.] # setting 4 fixed t values
+m.t = [6.,9.,12.,15.,18.,21.,24.] # setting 4 fixed t values
 
 # define settings
@@ -17,4 +17,5 @@
 #m.verbose = True # making the programe verbose
 #m.out = "pdf" # output format
+m.colorb = "spectral" # color cycle according to a color map
 
 # get data and make plot with default settings
@@ -48,4 +49,5 @@
 S.p[0].xlabel="Potential temperature (K)"
 S.filename = "meso_profile"
+S.colorb = None # come back to default color cycle
 
 # make the plot
Index: trunk/UTIL/PYTHON/planetoplot_v2/examples/vertpress1d.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/examples/vertpress1d.py	(revision 977)
+++ trunk/UTIL/PYTHON/planetoplot_v2/examples/vertpress1d.py	(revision 977)
@@ -0,0 +1,50 @@
+#! /usr/bin/env python
+from ppclass import pp
+
+##################################################################
+##################################################################
+
+files = ["diagfi_start150.nc","diagfi_start175.nc","diagfi_start200.nc"]
+labs = ['$T_{ini}=150$ K','$T_{ini}=175$ K','$T_{ini}=200$ K']
+name = "profile_tini"
+
+#files = ["diagfi_start200.nc","diagfi_start200_Rayleigh.nc","diagfi_start200_A034.nc"]
+#labs = ['ref ($T_{ini}=200$ K)','ref + Rayleigh scatt.','ref + $A_{surf} = 0.34$']
+#name = "profile_tests"
+
+##################################################################
+##################################################################
+
+# OK retrieve pressure and temperatures
+press = pp(file=files,var="p",x=0,y=0,t=1.e15).get()
+temp = pp(file=files,var="temp",x=0,y=0,t=1.e15).get()
+
+# this must be done before the next step
+# ... because the next step is doing defineplot
+temp.superpose = True
+#temp.out = "png"
+temp.filename = name
+temp.includedate = False
+temp.colorb = "hot"
+
+# this is doing defineplot amongst other things
+temp.func(press)
+
+# customize plots
+count=0
+for yeah in temp.p:
+    yeah.logy = True
+    yeah.invert = True
+    yeah.swaplab = False
+    yeah.ylabel = "Pressure (Pa)"
+    yeah.xlabel = "Temperature (K)"
+    yeah.ymin = 1.
+    yeah.xmax = 230.
+    yeah.xmin = 70.
+    yeah.div = 32
+    yeah.label = labs[count]
+    yeah.title = "Equilibrium profile with a 1D globally-averaged model after 50 Saturn years"
+    count = count+1
+
+# finally make the plot
+temp.makeplot()
Index: trunk/UTIL/PYTHON/planetoplot_v2/pp.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/pp.py	(revision 972)
+++ trunk/UTIL/PYTHON/planetoplot_v2/pp.py	(revision 977)
@@ -74,4 +74,8 @@
 parser.add_option('--xcoeff',action='append',dest='xcoeff',type="float",default=None,help="[1D] multiply x axis")
 parser.add_option('--ycoeff',action='append',dest='ycoeff',type="float",default=None,help="[1D] multiply y axis")
+parser.add_option('--xmin',action='append',dest='xmin',type="float",default=None,help="[1D] min bound x axis")
+parser.add_option('--ymin',action='append',dest='ymin',type="float",default=None,help="[1D] min bound y axis")
+parser.add_option('--xmax',action='append',dest='xmax',type="float",default=None,help="[1D] max bound x axis")
+parser.add_option('--ymax',action='append',dest='ymax',type="float",default=None,help="[1D] max bound y axis")
 # -- 2D plot
 parser.add_option('-C','--colorb',action='append',dest='colorb',type="string",default=None,help="[2D] colormap: http://micropore.files.wordpress.com/2010/06/colormaps.png")
Index: trunk/UTIL/PYTHON/planetoplot_v2/pp_reload.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/pp_reload.py	(revision 972)
+++ trunk/UTIL/PYTHON/planetoplot_v2/pp_reload.py	(revision 977)
@@ -7,4 +7,5 @@
 from optparse import OptionParser ### TBR by argparse
 from ppclass import pp
+from ppplot import rainbow
 # -----------------------------------------------------------------------
 parser = OptionParser()
@@ -34,4 +35,5 @@
         plot.proj = opt.proj
     if opt.colorb is not None:
+      yeah.colorb = opt.colorb
       for plot in yeah.p:
         plot.colorb = opt.colorb
Index: trunk/UTIL/PYTHON/planetoplot_v2/ppclass.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/ppclass.py	(revision 972)
+++ trunk/UTIL/PYTHON/planetoplot_v2/ppclass.py	(revision 977)
@@ -784,4 +784,5 @@
                     if self.title is not None: plobj.title = self.title
                     if self.units is not None: plobj.units = self.units
+                    if self.colorb is not None: plobj.colorb = self.colorb
                     # -- 1D specific
                     if dp == 1:
@@ -795,5 +796,4 @@
                         if self.vmin is not None: plobj.vmin = self.vmin
                         if self.vmax is not None: plobj.vmax = self.vmax
-                        if self.colorb is not None: plobj.colorb = self.colorb
                     # finally append plot object
                     self.p.append(plobj)
@@ -909,4 +909,9 @@
                     self.fig.add_subplot(1,1,1,axisbg=pl.axisbg) # define one subplot (still needed for user-defined font sizes)
                     sav = pl.xlabel,pl.ylabel,pl.xcoeff,pl.ycoeff,pl.title,pl.swaplab # save titles and labels
+                    # possibility to color lines according to a color map
+                    # ... made so that all plots span the whole color map automatically.
+                    if self.colorb is not None: 
+                        if self.verbose: print "**** OK. We make a rainbow spaghetti plot with color map ",self.colorb
+                        ppplot.rainbow(cb=self.colorb,num=self.howmanyplots)
                 else: 
                     pl.invert = False ; pl.lstyle = None # don't invert again axis
@@ -932,5 +937,5 @@
         # once completed show the plot (cannot show intermediate plotin)
         # ... added a fix (customplot=True) for the label problem in basemap
-        print "**** PPCLASS. Done step: makeplot"
+        if not self.quiet: print "**** PPCLASS. Done step: makeplot"
         if (self.n == self.howmanyplots):
             ppplot.save(mode=self.out,filename=self.filename,folder=self.folder,custom=self.customplot,includedate=self.includedate,res=self.res)
@@ -1133,4 +1138,24 @@
             except:
                 try: self.p[iii].wscale = opt.wscale[0]
+                except: pass
+            ###
+            try: self.p[iii].xmin = opt.xmin[iii]
+            except:
+                try: self.p[iii].xmin = opt.xmin[0]
+                except: pass
+            ###
+            try: self.p[iii].ymin = opt.ymin[iii]
+            except:
+                try: self.p[iii].ymin = opt.ymin[0]
+                except: pass
+            ###
+            try: self.p[iii].xmax = opt.xmax[iii]
+            except:
+                try: self.p[iii].xmax = opt.xmax[0]
+                except: pass
+            ###
+            try: self.p[iii].ymax = opt.ymax[iii]
+            except:
+                try: self.p[iii].ymax = opt.ymax[0]
                 except: pass
 
Index: trunk/UTIL/PYTHON/planetoplot_v2/ppplot.py
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/ppplot.py	(revision 972)
+++ trunk/UTIL/PYTHON/planetoplot_v2/ppplot.py	(revision 977)
@@ -180,4 +180,11 @@
 # useful functions #
 ####################
+
+# a function to change color lines according to a color map (idea by A. Pottier)
+# ... two optional arguments: color maps + a number telling how much intervals are needed
+def rainbow(cb="jet",num=8):
+    ax = mpl.gca()
+    pal = mpl.cm.get_cmap(name=cb)
+    ax._get_lines.set_color_cycle([pal(i) for i in np.linspace(0,0.9,num)])
 
 # a function to define subplot
@@ -299,4 +306,5 @@
                  ycoeff=1.,\
                  fmt=None,\
+                 colorb="jet",\
                  units="",\
                  title=""):
@@ -318,4 +326,5 @@
         self.fmt = fmt
         self.units = units
+        self.colorb = colorb
         ## other useful arguments
         ## ... not used here in ppplot but need to be attached to plot object
@@ -382,4 +391,8 @@
         self.marker = marker
         self.label = label
+        self.xmin = None
+        self.ymin = None
+        self.xmax = None
+        self.ymax = None
 
     # define_from_var
@@ -405,4 +418,8 @@
         mpl.grid(color='grey')
         if self.lstyle == "": self.lstyle = " " # to allow for no line at all with ""
+        # set dummy x axis if not defined
+        if self.absc is None: 
+            self.absc = np.array(range(self.field.shape[0]))
+            print "!! WARNING !! dummy coordinates on x axis"
         # swapping if requested
         if self.swap:  x = self.field ; y = self.absc
@@ -427,6 +444,6 @@
         # ... this must be after plot so that axis bounds are well-defined
         # ... also inverting must be after making the thing logarithmic
-        if self.logx: mpl.semilogx()
-        if self.logy: mpl.semilogy()
+        if self.logx: mpl.xscale("log") # not mpl.semilogx() because excludes log on y
+        if self.logy: mpl.yscale("log") # not mpl.semilogy() because excludes log on x
         if self.invert: ax = mpl.gca() ; ax.set_ylim(ax.get_ylim()[::-1])
         # add a label for line(s)
@@ -446,4 +463,6 @@
         if xmin < x1: x1 = xmin
         if xmax > x2: x2 = xmax
+        if self.xmin is not None: x1 = self.xmin
+        if self.xmax is not None: x2 = self.xmax
         ax.set_xbound(lower=x1,upper=x2)
         # y-axis
@@ -453,4 +472,6 @@
         if ymin < y1: y1 = ymin
         if ymax > y2: y2 = ymax
+        if self.ymin is not None: y1 = self.ymin
+        if self.ymax is not None: y2 = self.ymax
         ax.set_ybound(lower=y1,upper=y2)
         ## set with .div the number of ticks. (is it better than automatic?)
@@ -478,5 +499,4 @@
                  proj="cyl",\
                  back=None,\
-                 colorb="jet",\
                  trans=1.0,\
                  addvecx=None,\
@@ -498,5 +518,4 @@
         self.proj = proj
         self.back = back
-        self.colorb = colorb
         self.trans = trans
         self.addvecx = addvecx
@@ -527,15 +546,9 @@
         # get what is done in the parent class...
         plot.make(self)
-        if self.fmt is None: self.fmt = "%.2e"
+        if self.fmt is None: self.fmt = "%.1e"
         # ... then add specific stuff
         ############################################################################################
         ### PRE-SETTINGS
         ############################################################################################
-        # transposing if necessary
-        shape = self.field.shape
-        if shape[0] != shape[1]:
-         if len(self.absc) == shape[0] and len(self.ordi) == shape[1]:
-            print "!! WARNING !! Transposing axes"
-            self.field = np.transpose(self.field)
         # set dummy xy axis if not defined
         if self.absc is None: 
@@ -547,4 +560,10 @@
             self.mapmode = False
             print "!! WARNING !! dummy coordinates on y axis"
+        # transposing if necessary
+        shape = self.field.shape
+        if shape[0] != shape[1]:
+         if len(self.absc) == shape[0] and len(self.ordi) == shape[1]:
+            print "!! WARNING !! Transposing axes"
+            self.field = np.transpose(self.field)
         # bound field
         zevmin, zevmax = calculate_bounds(self.field,vmin=self.vmin,vmax=self.vmax)
Index: trunk/UTIL/PYTHON/planetoplot_v2/set_ppclass.txt
===================================================================
--- trunk/UTIL/PYTHON/planetoplot_v2/set_ppclass.txt	(revision 972)
+++ trunk/UTIL/PYTHON/planetoplot_v2/set_ppclass.txt	(revision 977)
@@ -13,5 +13,5 @@
   # t-axis: possible names to search for. add in the line with a separating ;
   #
-Times;time;Time;time_counter;Ls
+Times;time;Time;Ls
   # area: possible names to search for. add in the line with a separating ;
   #
