Index: trunk/tools/documentation/plotting/gallery.html
===================================================================
--- trunk/tools/documentation/plotting/gallery.html	(revision 1544)
+++ trunk/tools/documentation/plotting/gallery.html	(revision 1545)
@@ -19,4 +19,5 @@
       <A HREF="2Dshad_line_time.html"><IMG SRC="figs/hus-ps_vert-sec_shad-line_time.png" ALT="2D shadow line time" STYLE="float:left;width:200px;height:200px" TARGET="value"></IMG></A>
       <A HREF="draw_bar.html"><IMG SRC="figs/bar_rain_CRU-NCEP_norm.png" ALT="bar char plot" STYLE="float:left;width:200px;height:200px" TARGET="value"></IMG></A>
+      <A HREF="bar_line.html"><IMG SRC="figs/bar-line_rain_CRU-NCEP_norm.png" ALT="bar char and lines plot" STYLE="float:left;width:200px;height:200px" TARGET="value"></IMG></A>
       <A HREF="bar_time.html"><IMG SRC="figs/bar_time_rain_CRU-NCEP_DJFmean_norm.png" ALT="bar char plot time" STYLE="float:left;width:200px;height:200px" TARGET="value"></IMG></A>
       <A HREF="barbs.html"><IMG SRC="figs/wind_barbs_2001111003_wss.png" ALT="wind-barbs" STYLE="float:left;width:200px;height:200px" TARGET="value"></IMG></A>
Index: trunk/tools/documentation/plotting/plotting.html
===================================================================
--- trunk/tools/documentation/plotting/plotting.html	(revision 1544)
+++ trunk/tools/documentation/plotting/plotting.html	(revision 1545)
@@ -15,4 +15,5 @@
       <A CLASS="lc" HREF="2Dshad_line_time.html" TARGET="value">2D shadow line time</A><BR>
       <A CLASS="lc" HREF="draw_bar.html" TARGET="value">bar</A><BR>
+      <A CLASS="lc" HREF="bar_line.html" TARGET="value">bar & line</A><BR>
       <A CLASS="lc" HREF="bar_time.html" TARGET="value">bar_time</A><BR>
       <A CLASS="lc" HREF="barbs.html" TARGET="value">barbs</A><BR>
Index: trunk/tools/drawing.py
===================================================================
--- trunk/tools/drawing.py	(revision 1544)
+++ trunk/tools/drawing.py	(revision 1545)
@@ -47,5 +47,5 @@
 ## e.g. # drawing.py -o draw_bar -f 'Forcing_rainstats_OKstomate_CRUNCEP_spinup_SESA_norm_meanstd_stat2.nc;time_counter,0@12@1;time_counter;rainnorm:Forcing_rainstats_OKstomate_CRUNCEP_spinup_SACZ_norm_meanstd_stat2.nc;time_counter,0@12@1;time_counter;rainnorm' -S 'Stringlist,%s,January@Feburary@March@Arpil@May@June@July@August@September@October@November@December,25,pretty,auto,auto,auto:time!since!1958-01-01:pr:y:seconds:mmd-1:SESA,SACZ:#AA0000,#0000AA:1000000.:normalized!evolution!of!precipitaion!with!CRU-NCEP!forcing:0|10:png:bar_rain_CRU-NCEP_norm:yes'
 ## e.g. # drawing.py -o draw_bar_time -f 'Forcing_rainstats_OKstomate_CRUNCEP_spinup_SESA_DJFmean_norm_meanstd_stat2.nc;time_centered,-1;time_centered;rainnorm:Forcing_rainstats_OKstomate_CRUNCEP_spinup_SACZ_DJFmean_norm_meanstd_stat2.nc;time_centered,-1;time_centered;rainnorm' -S 'auto;pr;1;y;None;year|seconds!since!1958-01-01!00:00:00|exct,5,y|%Y;SESA,SACZ;#AA0000,#0000AA;10000000.;normalized!evolution!of!DJFmean!of!precipitaion!with!CRU-NCEP!forcing;0|10;png;bar_time_rain_CRU-NCEP_DJFmean_norm;yes'
-
+## e.g. # drawing.py -o draw_bar_line -f 'Forcing_rainstats_OKstomate_CRUNCEP_spinup_SESA_norm_meanstd_stat2.nc;time_counter,0@12@1;time_counter;rainnorm;bar:Forcing_rainstats_OKstomate_CRUNCEP_spinup_SESA_norm_meanstd_stat2.nc;time_counter,12@24@1;time_counter;rainnorm;bar:Forcing_rainstats_OKstomate_CRUNCEP_spinup_SACZ_norm_meanstd_stat2.nc;time_counter,0@12@1;time_counter;rainnorm;line:Forcing_rainstats_OKstomate_CRUNCEP_spinup_SACZ_norm_meanstd_stat2.nc;time_counter,12@24@1;time_counter;rainnorm;line' -S 'Stringlist,%s,January@Feburary@March@April@May@June@July@August@September@October@November@December@Jan@Feb@Mar@Apr@May@Jun@Jul@Aug@Sept@Oct@Nov@Dec,25,pretty,auto,auto,auto:time!since!1958-01-01:pr:x:-4.,4.:seconds:1:$SESA_{1958}$,$SESA_{1959}$,$SACZ_{1958}$,$SACZ_{1959}$:#AA0000,#0000AA:1000000.:#00AA00,#AAAA00:-.:,:2.:2.:all:normalized!evolution!of!precipitation!with!CRU-NCEP!forcing:0|10:png:bar-line_rain_CRU-NCEP_norm:yes'
 
 
@@ -83,4 +83,5 @@
 # draw_2lines_time: Function to plot two time-lines in different axes (x/x2 or y/y2)
 # draw_bar: Function to plot a bar char figure with multiple sources
+# draw_bar_line: Function to plot a bar char and line figure with multiple sources
 # draw_bar_time: Function to plot a bar char figure with multiple sources and time axis
 # draw_barbs: Function to plot wind barbs
@@ -115,6 +116,6 @@
   'draw_2D_shad_cont', 'draw_2D_shad_2cont', 'draw_2D_shad_cont_time',               \
   'draw_2D_shad_line',                                                               \
-  'draw_2D_shad_line_time', 'draw_bar', 'draw_bar_time', 'draw_barbs',               \
-   'draw_basins',                                                                    \
+  'draw_2D_shad_line_time', 'draw_bar', 'draw_bar_line', 'draw_bar_time',            \
+  'draw_barbs', 'draw_basins',                                                       \
   'draw_2lines', 'draw_2lines_time', 'draw_lines', 'draw_lines_time',                \
   'draw_Neighbourghood_evol',                                                        \
@@ -6470,5 +6471,5 @@
         [yunits]: units of the y-label
         [aval]: which acis should be used for the values ('x' or 'y')
-        [labels]: ',' list of labels for the legend ('None' for no-labels)
+        [labels]: ',' list of labels for the legend ('None' for no-labels, '!' for spaces)
         [colors]: ',' list of colors (single value same color, 'auto' automatic)
         [wdth]: width of the bars
@@ -6501,5 +6502,5 @@
     xunits = values.split(':')[4]
     yunits = values.split(':')[5]
-    labels = gen.str_list(values.split(':')[6], ',')
+    labels = gen.str_list(values.split(':')[6].replace('!', ' '), ',')
     colors = gen.str_list(values.split(':')[7], ',')
     wdth = np.float(values.split(':')[8])
@@ -6627,5 +6628,5 @@
                'l': milisecond
           [tfmt]; desired format
-        [labels]: ',' list of labels for the legend ('None' for no-labels)
+        [labels]: ',' list of labels for the legend ('None' for no-labels, '!' for spaces)
         [colors]: ',' list of colors (single value same color, 'auto' automatic)
         [wdth]: width of the bars
@@ -6658,5 +6659,5 @@
     rangevals = values.split(';')[4]
     timevals = values.split(';')[5]
-    labels = gen.str_list(values.split(';')[6], ',')
+    labels = gen.str_list(values.split(';')[6].replace('!', ' '), ',')
     colors = gen.str_list(values.split(';')[7], ',')
     wdth = np.float(values.split(';')[8])
@@ -6769,6 +6770,6 @@
         valmin = np.float(rangevals.split(',')[0])
         valmax = np.float(rangevals.split(',')[1])
-        if valmin != 'auto': valmin = np.min(yvals)
-        if valmax != 'auto': valmax = np.max(yvals)
+        if valmin == 'auto': valmin = np.min(yvals)
+        if valmax == 'auto': valmax = np.max(yvals)
     yrange = [valmin, valmax]
 
@@ -6784,4 +6785,219 @@
     drw.plot_bars_time(tvals, yvals, timepos, timelabels, yaxis, dyu, aval, yrange,  \
      timen, yaxislab, labels, colors, wdth, graphtit, legloc, legsiz, kindfig, fign, \
+     close)
+
+    return
+
+def draw_bar_line(ncfile, values):
+    """ Function to plot a bar char and lines plot figure with multiple sources
+      ncfile = ':' list of [filen];[dimslice];[xvarn];[yvarn];[kind]
+        [filen]: name of the file
+        [dimslice]: '|' list of [dimn],[dimrange]
+          [dimn]: name of the dimension
+          [dimrange]: range for the slice
+            * [integer]: which value of the dimension
+            * -1: all along the dimension
+            * -9: last value of the dimension
+            * [beg]@[end]@[inc] slice from [beg] to [end] every [inc]
+            * NOTE, no dim name all the dimension size
+        [xvarn]: name of the variable to use for the x-positions
+        [yvarn]: name of the variable to use for the values
+        [kind]: Kind of plotting
+          'bar': for bar-plot
+          'line': for line-plot
+      values = [dimxyfmt]:[xaxislab]:[yaxislab]:[xunits]:[yunits]:[aval]:[rangevals]:[labels]:
+          [colors]:[wdth]:[colns]:[lines]:[points]:[lwdths]:[psizes]:[freqv]:[graphtit]:[legvalues]:
+          [kindfig]:[fign]:[close]
+        [dimxyfmt]=[dxs],[dxf],[Ndx],[ordx],[dys],[dyf],[Ndy],[ordy]: format of the values at each 
+            axis (or single 'auto' for 'auto','auto')
+          [dxs]: style of x-axis ('auto' for 'pretty')
+            'Nfix', values computed at even 'Ndx'
+            'Stringlist', a given list of strings
+            'Vfix', values computed at even 'Ndx' increments
+            'pretty', values computed following aprox. 'Ndx' at 'pretty' intervals (2.,2.5,4,5,10)
+          [dxf]: format of the labels at the x-axis
+          [Ndx]: Number of ticks at the x-axis (for 'Stringlist', '@' list of labels)
+          [ordx]: angle of orientation of ticks at the x-axis ('auto' for horizontal)
+          [dys]: style of y-axis ('auto' for 'pretty')
+          [dyf]: format of the labels at the y-axis
+          [Ndy]: Number of ticks at the y-axis
+          [ordy]: angle of orientation of ticks at the y-axis ('auto' for horizontal)
+        [xaxislab]: Label for the x-axis ('!' for spaces)
+        [yaxislab]: Label for the y-axis ('!' for spaces)
+        [xunits]: units of the x-label ('None' for no units)
+        [yunits]: units of the y-label
+        [aval]: which acis should be used for the values ('x' or 'y')
+        [rangevals]: Range of the axis with the values (singel 'None' for 'auto','auto')
+         [vmin],[vmax]: minimum and maximum values
+           'auto': the computed minimumm or maximum of the values  
+        [labels]: ',' list of labels for the legend ('None' for no-labels, '!' for spaces)
+        [colors]: ',' list of colors (single value same color, 'auto' automatic)
+        [wdth]: width of the bars
+        [colns]= ',' list of color names ('None' for automatic, single value for all the same)
+        [lines]= ',' list of style of lines ('None' for automatic, single value for all the same)
+        [points]= '@' list of style of points ('None' for automatic, single value for all the same)
+        [lwdths]= ',' list of withs of lines ('None' for automatic, single value for all the same)
+        [psizes]= ',' list of size of points ('None' for automatic, single value for all the same)
+        [freqv]= frequency of values ('all' for all values)
+        [graphtit]: title of the figure '!' for spaces
+        [legvalues]=[locleg]|[fontsize]: 
+          [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',
+            9: 'upper center', 10: 'center'
+          [fontsize]: font size for the legend (auto for 12)
+        [kindfig]: kind of output figure (png, pdf, ps)
+        [fign]: name of the figure (without extension)
+        [close]: whether figure should be close or not
+    """
+    fname = 'draw_bar_line'
+
+    if values == 'h':
+        print fname + '____________________________________________________________'
+        print draw_bar_line.__doc__
+        quit()
+
+    expectargs = '[dimxyfmt]:[xaxislab]:[yaxislab]:[aval]:[rangevals]:[xunits]:' +   \
+      '[yunits]:[labels]:[colors]:[wdth]:[colns]:[lines]:[points]:[lwdths]:' +       \
+      '[psizes]:[freqv]:[graphtit]:[legvalues]:[kindfig]:[fign]:' + \
+      '[close]'
+    drw.check_arguments(fname,values,expectargs,':')
+
+    dimxyfmt = values.split(':')[0]
+    xaxislab = values.split(':')[1].replace('!',' ')
+    yaxislab = values.split(':')[2].replace('!',' ')
+    aval = values.split(':')[3]
+    rangevals = values.split(':')[4]
+    xunits = values.split(':')[5]
+    yunits = values.split(':')[6]
+    labels = gen.str_list(values.split(':')[7].replace('!', ' '), ',')
+    colors = gen.str_list(values.split(':')[8], ',')
+    wdth = np.float(values.split(':')[9])
+    colns = gen.str_list(values.split(':')[10], ',')
+    lines = gen.str_list(values.split(':')[11], ',')
+    points = gen.str_list(values.split(':')[12], '@')
+    lwdths = gen.str_list_k(values.split(':')[13], ',', 'R')
+    psizes = gen.str_list_k(values.split(':')[14], ',', 'R')
+    freqv0 = values.split(':')[15]
+    graphtit = values.split(':')[16].replace('!',' ')
+    legvalues = values.split(':')[17]
+    kindfig = values.split(':')[18]
+    fign = values.split(':')[19]
+    close = gen.Str_Bool(values.split(':')[20])
+
+    # files and values
+    filedvs = ncfile.split(':')
+    barxvals = []
+    baryvals = []
+    linexvals = []
+    lineyvals = []
+    namebars = []
+    namelines = []
+
+    valmin = gen.fillValueF
+    valmax = -gen.fillValueF
+    print '  ' + fname + 'plotting _______'
+    il = 0
+    for fdv in filedvs:
+        filen = fdv.split(';')[0]
+        dimrange = fdv.split(';')[1]
+        xvarn = fdv.split(';')[2]
+        yvarn = fdv.split(';')[3]
+        plotk = fdv.split(';')[4]
+        print '  ', filen, 'with', plotk
+
+        if not os.path.isfile(filen):
+            print errormsg
+            print '  ' + fname + ': file "' + filen + '" does not exist !!'
+            quit(-1)
+
+        onc = NetCDFFile(filen, 'r')
+        if not onc.variables.has_key(xvarn):
+            print errormsg
+            print '  ' + fname + ': file "' + filen + "' does not have variable '" + \
+              xvarn + "' for the x-values !!"
+            print '    available ones:', onc.variables.keys()
+            onc.close()
+            quit(-1)
+        if not onc.variables.has_key(yvarn):
+            print errormsg
+            print '  ' + fname + ': file "' + filen + "' does not have variable '" + \
+              yvarn + "' for the y-values !!"
+            print '    available ones:', onc.variables.keys()
+            onc.close()
+            quit(-1)
+
+        oxvar = onc.variables[xvarn]
+        oyvar = onc.variables[yvarn]
+        xvs, xdims = ncvar.slice_variable(oxvar, dimrange.replace(',',':'))
+        yvs, ydims = ncvar.slice_variable(oyvar, dimrange.replace(',',':'))
+        if len(xvs.shape) != 1:
+            print errormsg
+            print '  ' + fname + ': provided slice:', dimrange, "for variable '" +   \
+              xvarn + "' does not provide a rank-1 value !!"
+            print '    resultant shape:', xvs.shape, 'dimensions:', xdims, 'fix it!!'
+            quit(-1)
+        if len(yvs.shape) != 1:
+            print errormsg
+            print '  ' + fname + ': provided slice:', dimrange, "for variable '" +   \
+              yvarn + "' does not provide a rank-1 value !!"
+            print '    resultant shape:', yvs.shape, 'dimensions:', ydims, 'fix it!!'
+            quit(-1)
+
+        # Location of each kind
+        if plotk == 'bar':
+            barxvals.append(list(xvs))
+            baryvals.append(list(yvs))
+            if labels is not None: namebars.append(labels[il])
+        elif plotk == 'line':
+            linexvals.append(list(xvs))
+            lineyvals.append(list(yvs))
+            if labels is not None: namelines.append(labels[il])
+        else:
+            print errormsg
+            print '  ' + fname + ": kind of input '" + plotk + "' not ready!!"
+            print '    available ones:', ['bar', 'line']
+            quit(-1)
+
+        yvsn = np.min(yvs)
+        yvsx = np.max(yvs)
+        if yvsn < valmin: valmin = yvsn
+        if yvsx > valmax: valmax = yvsx
+
+        onc.close()
+        il = il + 1
+
+    # ranges
+    if rangevals == 'None':
+        valmin = yvsn
+        valmax = yvsx
+    else:
+        valmin = np.float(rangevals.split(',')[0])
+        valmax = np.float(rangevals.split(',')[1])
+        if valmin == 'auto': valmin = yvsn
+        if valmax == 'auto': valmax = yvsx
+    yrange = [valmin, valmax]
+
+    xstyl, xaxf, Nxax, xaxor, ystyl, yaxf, Nyax, yaxor = drw.format_axes(dimxyfmt,',')
+    xaxis = [xstyl, xaxf, Nxax, xaxor]
+    yaxis = [ystyl, yaxf, Nyax, yaxor]
+
+    # Frequqnecy for lines
+    if freqv0 == 'all':
+        freqv = None
+    else:
+        freqv = int(freqv0)
+
+    # Legend 
+    legloc, legsiz = drw.legend_values(legvalues,'|')
+
+    # units
+    if xunits == 'None': dxu = None
+    else: dxu = xunits
+    dyu = yunits
+
+    drw.plot_bars_line(barxvals, baryvals, linexvals, lineyvals, xaxis, yaxis, dxu,  \
+     dyu, aval, yrange, xaxislab, yaxislab, namebars, namelines, colors, wdth, colns,\
+     lines, points, lwdths, psizes, freqv, graphtit, legloc, legsiz, kindfig, fign,  \
      close)
 
@@ -6810,5 +7026,5 @@
   'draw_2D_shad_cont_time',                                                          \
   'draw_2D_shad_line', 'draw_2D_shad_line_time', 'draw_2lines', 'draw_2lines_time',  \
-  'draw_bar', 'draw_bar_time', 'draw_lines',                                         \
+  'draw_bar', 'draw_bar_line', 'draw_bar_time', 'draw_lines',                        \
   'draw_lines_time', 'draw_points', 'draw_Taylor', 'draw_topo_geogrid_boxes',        \
   'draw_trajectories', 'draw_vals_trajectories', 'variable_values']
@@ -6868,4 +7084,6 @@
     elif oper == 'draw_bar':
         draw_bar(opts.ncfile, opts.values)
+    elif oper == 'draw_bar_line':
+        draw_bar_line(opts.ncfile, opts.values)
     elif oper == 'draw_bar_time':
         draw_bar_time(opts.ncfile, opts.values)
Index: trunk/tools/drawing_tools.py
===================================================================
--- trunk/tools/drawing_tools.py	(revision 1544)
+++ trunk/tools/drawing_tools.py	(revision 1545)
@@ -85,4 +85,6 @@
 # plot_2lines_time: Function to plot two time-lines in different axes (x/x2 or y/y2)
 # plot_bars: Function to plot a bar plot with multiple columns
+# plot_bars_line: Function to plot a bar and lines plot with multiple columns
+# plot_bars_time: Function to plot a bar plot with multiple columns with time axis
 # plot_lines: Function to plot a collection of lines
 # plot_Taylor: Function to draw a Taylor diagram (Taylor 2001)
@@ -9170,5 +9172,5 @@
         if len(NOTcoinc) != 0:
             xticks = xticks + NOTcoinc
-            xticks.sort
+            xticks.sort()
 
     dxn = np.min(xvalues)
@@ -9264,5 +9266,5 @@
             if labels is not None:
                 plt.barh(xvls+xrels, yvalues[iv], height=width, color=colvs[iv],     \
-                  label=labels[iv])
+                  label=gen.latex_text(labels[iv]))
             else:
                 plt.barh(xvls+xrels, yvalues[iv], height=width, color=colvs[iv])
@@ -9270,5 +9272,5 @@
             if labels is not None:
                 plt.bar(xvls+xrels, yvalues[iv], width=width, color=colvs[iv],       \
-                  label=labels[iv])
+                  label=gen.latex_text(labels[iv]))
             else:
                 plt.bar(xvls+xrels, yvalues[iv], width=width, color=colvs[iv])
@@ -9394,5 +9396,5 @@
             if labels is not None:
                 plt.barh(xvls+xrels, yvalues[iv], height=width, color=colvs[iv],     \
-                  label=labels[iv])
+                  label=gen.latex_text(labels[iv]))
             else:
                 plt.barh(xvls+xrels, yvalues[iv], height=width, color=colvs[iv])
@@ -9400,5 +9402,5 @@
             if labels is not None:
                 plt.bar(xvls+xrels, yvalues[iv], width=width, color=colvs[iv],       \
-                  label=labels[iv])
+                  label=gen.latex_text(labels[iv]))
             else:
                 plt.bar(xvls+xrels, yvalues[iv], width=width, color=colvs[iv])
@@ -9427,2 +9429,223 @@
 
 
+def plot_bars_line(bxvalues, byvalues, lxvalues, lyvalues, xaxv, yaxv, dimxu, dimyu, \
+  valaxis, valrange, xlabel, ylabel, blabels, llabels, bcols, width, coll, typl, ptl,\
+   wdtl, ptz, ptf, gtit, lloc, lsiz, kfig, figname, ifclose):
+    """ Function to plot a bar and lines plot with multiple columns
+      bxvalues= list with the values along the x-ais for bar plot
+      byvalues= list with the values along the y-ais for bar plot
+      lxvalues= list with the values along the x-ais for lines plot
+      lyvalues= list with the values along the y-ais for lines plot
+      [x/y]axv= values at the axes of x and y
+      dim[x/y]u= units at the axes of x and y
+      valaxis= which axis holds the values 'x' or 'y'
+      valrange= range of values along the values axis
+      xlabel= label at the x-axis
+      ylabel= label at the y-axis
+      blabels= list of labels for legend (None for no legend) for bars
+      llabels= list of labels for legend (None for no legend) for lines
+      bcols= list of colors for the bars (single value for the same, 'auto' for automatic)
+      width= size of the column
+      coll= ',' list of colors for the lines, 'None' for automatic, single
+        value all the same
+      typl= ',' list of type 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
+      wdtl= ',' list of width for the lines, 'None' for automatic, single
+        value all the same
+      ptz= ',' list of size of points for the lines, 'None' for automatic, single
+        value all the same
+      ptf= frequency of point plotting, 'all' for all time steps
+      gtit= title of the figure
+      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'
+      lsiz= font size of the legend
+      kfig= kind of output: pdf, png, ps
+      figname= name of the figure
+      ifclose= whether figure should be closed
+    """
+    fname = 'plot_bars_line'
+
+    bNvalues = len(bxvalues)
+    lNvalues = len(lxvalues)
+
+    if lNvalues > 0:
+        # Lines' characteristics
+        cols, lins, pts, lws, pss = ColorsLinesPointsStyles(lNvalues, coll, typl,    \
+          ptl, wdtl, ptz, ptf)
+
+    # Maximum number of values:
+    Lmaxvals = -10
+    if bNvalues > 0:
+        xticks = bxvalues[0]
+        for iv in range(bNvalues):
+            if len(bxvalues[iv]) > Lmaxvals: Lmaxvals = len(bxvalues[iv])
+            NOTcoinc = list(set(bxvalues[iv]).difference(set(xticks)))
+            if len(NOTcoinc) != 0:
+                xticks = xticks + NOTcoinc
+                xticks.sort()
+    if lNvalues > 0:
+        if bNvalues == 0: xticks = lxvalues[0]
+        for iv in range(lNvalues):
+            if len(lxvalues[iv]) > Lmaxvals: Lmaxvals = len(lxvalues[iv])
+            NOTcoinc = list(set(lxvalues[iv]).difference(set(xticks)))
+            if len(NOTcoinc) != 0:
+                xticks = xticks + NOTcoinc
+                xticks.sort()
+
+    dxn = np.min([bxvalues, lxvalues])
+    dxx = np.max([bxvalues, lxvalues])
+    dyn = valrange[0]
+    dyx = valrange[1]
+
+    axstyles = ['pretty', 'Nfix', 'Stringlist', 'Vfix']
+    if xaxv[0] == 'pretty':
+        dimxt = np.array(gen.pretty_int(dxn,dxx,xaxv[2]))
+        dimxl = np.array(dimxt, dtype=str)
+    elif xaxv[0] == 'Nfix':
+        dimxl = np.arange(0.,1.,1./(xaxv[2]+1))
+        dimxt = np.arange(0.,1.,1./varsv.shape[1])
+    elif xaxv[0] == 'Stringlist':
+        if len(xaxv[2]) != len(xticks):
+            print warnmsg
+            print '  ' + fname + ': number of ticks to plot=', len(xticks),         \
+              'and number of labels provided', len(xaxv[2]), 'differ !!'
+            print '  ' + fname + ': ticks to plot=', xticks, 'and provided labels', \
+                xaxv[2], 'differ !!'
+
+        dimxl = xaxv[2]
+        dimxt = xticks
+    elif xaxv[0] == 'Vfix':
+        dxnvfix = int(dxn/xaxv[2])
+        dimxt = np.arange(dxnvfix*xaxv[2],dxx,xaxv[2])
+    else:
+        print errormsg
+        print '  ' + fname + ": x-xais style '" + xaxv[0] + "' not ready !!"
+        print '    available ones: ', axstyles
+        quit(-1)
+
+    if yaxv[0] == 'pretty':
+        dimyt = np.array(gen.pretty_int(dyn,dyx,yaxv[2]))
+        dimyl = np.array(dimyt, dtype=str)
+    elif yaxv[0] == 'Nfix':
+        dimyt = np.arange(0.,1.,1./(yaxv[2]+1))
+        dimyl = np.arange(0.,1.,1./varsv.shape[0])
+        axytype='fixpixel'
+    elif yaxv[0] == 'Vfix':
+        dynvfix = int(dyn/yaxv[2])
+        dimyt = np.arange(dynvfix*xaxv[2],dyx,yaxv[2])
+        axytype='data'
+    else:
+        print errormsg
+        print '  ' + fname + ": x-xais style '" + xaxv[0] + "' not ready !!"
+        print '    available ones: ', axstyles
+        quit(-1)
+
+    if valaxis == 'x':
+        orient = 'horizontal'
+    else:
+        orient = 'vertical'
+
+    bcolvs = []
+    if len(bcols) == 1:
+        if cols[0] == 'auto':
+            bcolvs = colorsauto[0:bNvalues+1]
+        else:
+            for ic in range(bNvalues): bcolvs.append(bcols[0])
+    else:
+        bcolvs = bcols
+    
+    if bNvalues > 0:
+        for iv in range(bNvalues):
+            xvls = bxvalues[iv]
+            Lvalues = len(xvls)
+            dxmean = np.mean(np.array(xvls[1:Lvalues])-np.array(xvls[0:Lvalues-1]))
+            if dxmean < width*bNvalues:
+                print warnmsg
+                print '  ' + fname + ': mean distance among x-values:', dxmean,      \
+                  'is smaller than the total number of bars with the given witdh (', \
+                  width, '):', width*bNvalues
+                print '    reduce widht of the column, should not be larger than:',  \
+                  dxmean/bNvalues
+            if width*bNvalues < 0.01*dxmean:
+                print warnmsg
+                print '  ' + fname + ': mean distance among x-values:', dxmean,      \
+                  'is 100-times larger than the total number of bars with the given'+\
+                  ' witdh (', width, '):', width*bNvalues
+                print '    increase widht of the column, should not be smaller ' +   \
+                  'than:', 0.01*dxmean
+
+            # Relative position of the column respect the xtick
+            if np.mod(bNvalues,2) == 0:
+                xrel = width*(iv - bNvalues/2.)
+            else:
+                xrel = width*(iv - (bNvalues-1)/2.)
+
+            xrels = xrel*np.ones((Lvalues),dtype=np.float)
+
+            if valaxis == 'x':
+                if blabels is not None:
+                    plt.barh(xvls+xrels, byvalues[iv], height=width,color=bcolvs[iv],\
+                      label=gen.latex_text(blabels[iv]))
+                else:
+                    plt.barh(xvls+xrels, byvalues[iv], height=width, color=bcolvs[iv])
+            else:
+                if blabels is not None:
+                    plt.bar(xvls+xrels, byvalues[iv], width=width, color=bcolvs[iv], \
+                      label=gen.latex_text(blabels[iv]))
+                else:
+                    plt.bar(xvls+xrels, byvalues[iv], width=width, color=bcolvs[iv])
+ 
+    if lNvalues > 0:
+        for iv in range(lNvalues):
+            if valaxis == 'x':
+                if llabels is not None:
+                    plt.plot(lyvalues[iv], lxvalues[iv], lins[iv], marker=pts[iv],   \
+                      color=cols[iv], label=gen.latex_text(llabels[iv]),             \
+                      linewidth=lws[iv], markersize=pss[iv], markevery=ptf)
+                else:
+                    plt.plot(lyvalues[iv], lxvalues[iv], lins[iv], marker=pts[iv],   \
+                      color=cols[iv],linewidth=lws[iv], markersize=pss[iv],          \
+                      markevery=ptf)
+            else:
+                if llabels is not None:
+                    plt.plot(lxvalues[iv], lyvalues[iv], lins[iv], marker=pts[iv],   \
+                      color=cols[iv], label=gen.latex_text(vlabels[iv]),             \
+                      linewidth=lws[iv], markersize=pss[iv], markevery=ptf)
+                else:
+                    plt.plot(lxvalues[iv], lyvalues[iv], lins[iv], marker=pts[iv],   \
+                      color=cols[iv],linewidth=lws[iv], markersize=pss[iv],          \
+                      markevery=ptf)
+
+    if valaxis == 'x':
+        plt.xticks(dimyt, dimyl, rotation=yaxv[3])
+        plt.yticks(dimxt, list(dimxl), rotation=xaxv[3])
+        plt.xlabel(ylabel + ' (' + units_lunits(dimyu) + ')')
+        if dimxu is not None:
+            plt.ylabel(xlabel + ' (' + units_lunits(dimxu) + ')') 
+        else:
+            plt.ylabel(xlabel)
+        plt.xlim(dyn, dyx)
+    else:
+        plt.xticks(dimxt, list(dimxl), rotation=xaxv[3])
+        plt.yticks(dimyt, list(dimyl), rotation=yaxv[3])
+        if dimxu is not None:
+            plt.xlabel(xlabel + ' (' + units_lunits(dimxu) + ')') 
+        else:
+            plt.xlabel(xlabel) 
+        plt.ylabel(ylabel + ' (' + units_lunits(dimyu) + ')')
+        plt.ylim(dyn, dyx)
+
+    if blabels is not None or llabels is not None:
+        plt.legend(loc=lloc, prop={'size':lsiz})
+
+    plt.title(gen.latex_text(gtit))
+    
+    output_kind(kfig, figname, ifclose)
+
+    return
+
+
