Index: trunk/tools/drawing.py
===================================================================
--- trunk/tools/drawing.py	(revision 1446)
+++ trunk/tools/drawing.py	(revision 1447)
@@ -31,4 +31,7 @@
 ## e.g. # drawing.py -o draw_Neighbourghood_evol -S 'vas:Time|-1|WRFtime,south_north|44|XLAT,west_east|88|XLONG:south_north,west_east:5:auto:time|($[DD]^{[HH]}$),time|($[DD]^{[HH]}$):exct,1,h|exct,3,h:$%d^{%H}$,$%d^{%H}$:5|pts|neighbourghood|temporal|evolution|on|2001|Nov.|at|x=88,|y=44:0.0,20.:rainbow,auto,auto:auto:png:vas_Neigh_evol:True' -f ~/PY/wrfout_d01_2001-11-11_00:00:00 -v V10
 ## e.g. # drawing.py -o draw_points -S 'SuperStorm/tslist.dat,#,3,2,1:SuperStorm|sfc|stations:auto:cyl,i:labelled,10,r:auto:None:0:png:stations_loc:True' -f 'geo_em.d02.nc,XLONG_M,XLAT_M,HGT_M,Time|0@west_east|30;180;1@south_north|175;255;1,height,0.,1500.,terrain,auto,auto,m'
+## e.g. # drawing.py -o draw_WindRose -S 'lon|7;lat|2:anglespeedfreq;16;8;40.;auto;auto:November!ERA-I!daily!mean!wind!at!850!hPa:png:cardinals:False:WindRose:True' -v u,v -f reg1_daymean_mon11_lev850_kmh.nc
+## e.g. # drawing.py -o draw_WindRose -S 'lon|7;lat|2:linepoint;multicoltime;time;auto;auto;auto;auto;exct,5,d;%m/%d;date!([DD]/[MM]):November!ERA-I!daily!mean!wind!at!850!hPa:png:cardinals:False:WindRose:True' -v u,v -f reg1_daymean_mon11_lev850_kmh.nc 
+## e.g. # drawing.py -o draw_Taylor -f 'file0.nc@var,file1.nc@var,file2.nc@var,file3.nc@var' -S '$10.\sin(0.05t2\pi)$:x:8:k,b,r,g,#FFBB00:$10.25\sin(0.025+0.05t2\pi)$,$10.25\sin(0.025+0.05125t2\pi)$,$10.5\sin(0.05+0.05t2\pi)$,$10.\sin(0.05+0.0525t2\pi)$:legend,0,8:norm:sinus!Taylor!diagram:png:yes:True' -v reffile.nc,var
 
 ## 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
@@ -81,6 +84,7 @@
 # draw_river_desc: Function to plot rivers' description from ORCHIDEE's routing scheme
 # draw_subbasin: Function to plot subbasin from 'routnig.nc' ORCDHIEE
+# draw_Taylor: Function to draw a Taylor diagram (Taylor 2001)
 # draw_vertical_levels: plotting vertical levels distribution
-# plot_WindRose: Function to plot a wind rose (from where the dinw blows)
+# draw_WindRose: Function to plot a wind rose (from where the dinw blows)
 
 mainn = 'drawing.py'
@@ -96,6 +100,6 @@
   'draw_Neighbourghood_evol',                                                        \
   'draw_points', 'draw_points_lonlat',                                               \
-  'draw_ptZvals', 'draw_river_desc', 'draw_subbasin', 'draw_timeSeries',             \
-  'draw_topo_geogrid',                                                               \
+  'draw_ptZvals', 'draw_river_desc', 'draw_subbasin', 'draw_Taylor',                 \
+  'draw_timeSeries', 'draw_topo_geogrid',                                            \
   'draw_topo_geogrid_boxes', 'draw_trajectories', 'draw_vals_trajectories',          \
   'draw_vectors',  'draw_vertical_levels', 'list_graphics', 'draw_WindRose',         \
@@ -5453,4 +5457,258 @@
     return
 
+def draw_Taylor(ncfile, values, varname):
+    """ Function to draw a Taylor diagram (Taylor 2001)
+     From script:
+     # Copyright: This document has been placed in the public domain.
+
+     Taylor diagram (Taylor, 2001) test implementation.
+
+     http://www-pcmdi.llnl.gov/about/staff/Taylor/CV/Taylor_diagram_primer.htm
+
+     __version__ = "Time-stamp: <2012-02-17 20:59:35 ycopin>"
+     __author__ = "Yannick Copin <yannick.copin@laposte.net>"
+
+      ncfile= ',' list of netCDF file and vartiable to use ([ncfile1]@[var1], [...[nmcvileN]@[varN]])
+      values=[reflabel]:[mark]:[col]:[size]:[labels]:[[kindlabels]:[taylorkind]:[imgtit]:[figkind]:[outputfile]:[close]
+        [reflabel]: label of the reference values in the graph
+        [mark]: ',' list of kind of markers (single value for the same for all values)
+        [col]: ',' list of color of markers (single value for the same for all values)
+        [size]: ',' list of sizes of markers (single value for the same for all values)
+        [labels]: ',' list of label of markers ('None' for without)
+        [kindlabels]: kind of labels in plot
+          'markfollow': on top of the mark of each pair of stddev, corr
+          'legend',[loc],[charsize]: as a traditional legend and [loc] position [charsize] (size of labels, 'auto' for 12)
+            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' 
+        [taylorkind]: kind of Taylor plot
+          'direct': direct values
+          'norm': normalized to the stdandard deviation of reference
+        [imgtit]: title of the image ('!' for spaces)
+        [figkind]: kind of the figure
+        [outputfile]: Whether is required to create a netcdf file with the information used in the Taylor diagram
+        [close]: whether the figure has to be closed
+      varname= [refncfile],[refvn] name of the reference faile and name of the variables within to use as reference
+    """
+    from scipy import stats as sts
+
+    fname = 'draw_Taylor'
+
+    if values == 'h':
+        print fname + '_____________________________________________________________'
+        print draw_Taylor.__doc__
+        quit()
+
+    expectargs = '[reflabel]:[mark]:[size]:[col]:[labels]:[kindlabels]:' +           \
+      '[taylorkind]:[imgtit]:[figkind]:[outputfile]:[close]'
+    drw.check_arguments(fname,values,expectargs,':')
+
+    reflabel = values.split(':')[0]
+    mark = values.split(':')[1]
+    col = values.split(':')[2]
+    size = values.split(':')[3]
+    labels = values.split(':')[4]
+    kindlabels = values.split(':')[5]
+    taylorkind = values.split(':')[6]
+    imgtit = values.split(':')[7].replace('!', ' ')
+    figkind = values.split(':')[8]
+    outputfile = gen.Str_Bool(values.split(':')[9])
+    close = gen.Str_Bool(values.split(':')[10])
+
+    # Reference parameters
+    refncfile = varname.split(',')[0]
+    refvn = varname.split(',')[1]
+
+    # Marker types
+    if mark.find(',') != -1:
+        marktyp = mark.split(',')
+    else:
+        marktyp = [mark]
+
+    # Marker sizes
+    if size.find(',') != -1:
+        marksize = size.split(',')
+    else:
+        marksize = [size]
+
+    # Marker Colors
+    if col.find(',') != -1:
+        markcol = col.split(',')
+    else:
+        markcol = [col]
+
+    # Marker Labels
+    if labels != 'None':
+        marklabs = [reflabel] + labels.split(',')
+    else:
+        marklabs = None
+
+    # Getting reference values
+    if not os.path.isfile(refncfile):
+        print errormsg
+        print '  ' + fname + ": reference file '" + refncfile + "' does not exist !!"
+        quit(-1)
+
+    # List of used files
+    usedfilens = []
+    # List of used variables
+    usedvarns = []
+
+    usedfilens.append(refncfile)
+    usedvarns.append(refvn)
+
+    oref = NetCDFFile(refncfile, 'r')
+    refvars = oref.variables.keys()
+    if not gen.searchInlist(refvars, refvn):
+        print errormsg
+        print '  ' + fname + ": reference file '" + refncfile + "' does not have " + \
+          "variable '" + refvn + "' !!"
+        quit(-1)
+    orefv = oref.variables[refvn]
+    refvals = orefv[:]
+    varunits = orefv.units
+    oref.close()
+        
+    # Statistics values
+    filevars = ncfile.split(',')
+    Nfiles = len(filevars)
+    meanvalues = []
+    stdvalues = []
+    corrvalues = []
+    corrpvalues = []
+    biasvalues = []
+    maevalues = []
+    rmsevalues = []
+
+    meanref = refvals.mean()
+    stdref = refvals.std()
+
+    if taylorkind == 'norm':
+        print '  ' + fname + ': normalizing diagram'
+        stdvalues.append(1.)
+    else:
+        stdvalues.append(stdref)
+
+    meanvalues.append(meanref)
+    corrvalues.append(1.)
+    corrpvalues.append(1.)
+    biasvalues.append(0.)
+    maevalues.append(0.)
+    rmsevalues.append(0.)
+
+    print '  ' + fname + ': File statistics _______'
+    for filevar in filevars:
+        filen = filevar.split('@')[0]
+        varn = filevar.split('@')[1]
+        if not os.path.isfile(refncfile):
+            print errormsg
+            print '  ' + fname + ": file '" + filen + "' does not exist !!"
+            quit(-1)
+        ovalf = NetCDFFile(filen, 'r')
+        valvars = ovalf.variables.keys()
+        if not gen.searchInlist(valvars, varn):
+            print errormsg
+            print '  ' + fname + ": file '" + filen + "' does not have variable '" + \
+              varn + "' !!"
+            quit(-1)
+        oval = ovalf.variables[varn]
+        vals = oval[:]
+        ovalf.close()
+
+        usedfilens.append(filen)
+        usedvarns.append(varn)
+
+        gen.same_shape(refvals,vals)
+
+        if taylorkind == 'norm':
+            valstdv = vals.std()/stdref
+        else:
+            valstdv = vals.std()
+        corrv, corrp = sts.pearsonr(refvals, vals)
+
+        diff = vals - refvals
+        meanvalues.append(vals.mean())
+        stdvalues.append(valstdv)
+        corrvalues.append(corrv)
+        corrpvalues.append(corrp)
+        biasvalues.append(diff.mean())
+        maevalues.append(np.abs(diff).mean())
+        rmsevalues.append(diff.std())
+        print '    ', filen, 'val bias:', diff.mean(), 'std:', valstdv, 'corr:',     \
+          corrv, 'rmse:', diff.std()
+
+    drw.plot_Taylor(stdvalues, corrvalues, corrpvalues, varunits, marktyp, marksize, \
+      markcol, marklabs, kindlabels, taylorkind, imgtit, figkind, close)
+
+    if outputfile:
+        ofilen = 'Taylor.nc'
+        print '  ' + fname + ": creation of oputput file '" + ofilen + "' "
+        outnc = NetCDFFile(ofilen, 'w')
+
+        # create dimensions
+        newdim = outnc.createDimension('file',Nfiles)
+        newdim = outnc.createDimension('Lstring',256)
+
+        # create variable-dimension
+        newvar = outnc.createVariable('file', 'c', ('file','Lstring'))
+        ncvar.writing_str_nc(newvar,usedfilens[1:-1],256)
+        ncvar.basicvardef(newvar,'used_files','files used in Taylor plot','-')
+
+        # Variables
+        newvar = outnc.createVariable('refvar', 'c', ('Lstring'))
+        ncvar.writing_1str_nc(newvar, 'refvarn', 256)
+        ncvar.basicvardef(newvar,'refvar','reference variable', varunits)
+        ncvar.set_attributek(newvar,'file',refncfile,'S')
+        ncvar.set_attributek(newvar,'mean',meanref,'R')
+        ncvar.set_attributek(newvar,'standard_deviation',stdref,'R')
+
+        newvar = outnc.createVariable('varn', 'c', ('file','Lstring'))
+        ncvar.writing_str_nc(newvar,usedvarns[1:-1],256)
+        ncvar.basicvardef(newvar,'used_variables','variables used in Taylor plot','-')
+
+        newvar = outnc.createVariable('stddev','f4',('file'))
+        newvar[:] = stdvalues[1:Nfiles+1]
+        ncvar.basicvardef(newvar,'standard_deviation','standard deviation',varunits)
+
+        newvar = outnc.createVariable('corr','f4',('file'))
+        newvar[:] = corrvalues[1:Nfiles+1]
+        ncvar.basicvardef(newvar,'correlation','correlation with reference values', \
+          '-')
+
+        newvar = outnc.createVariable('corrp','f4',('file'))
+        newvar[:] = corrpvalues[1:Nfiles+1]
+        ncvar.basicvardef(newvar,'p_value_correlations','p-value of the correlation'+\
+          ' with reference values', '-')
+
+        newvar = outnc.createVariable('mean','f4',('file'))
+        newvar[:] = meanvalues[1:Nfiles+1]
+        ncvar.basicvardef(newvar,'mean','mean of values', varunits)
+
+        newvar = outnc.createVariable('bias','f4',('file'))
+        newvar[:] = biasvalues[1:Nfiles+1]
+        ncvar.basicvardef(newvar,'bias','bias with reference values',varunits)
+
+        newvar = outnc.createVariable('mae','f4',('file'))
+        newvar[:] = maevalues[1:Nfiles+1]
+        ncvar.basicvardef(newvar,'mae','Mean Absolute Error with reference values',varunits)
+
+        newvar = outnc.createVariable('rmse','f4',('file'))
+        newvar[:] = rmsevalues[1:Nfiles+1]
+        ncvar.basicvardef(newvar,'rmse','Root Mean Square Error with reference values',varunits)
+
+        # Global values
+        outnc.setncattr('original_source_script', 'test_taylor_4panel.py')
+        outnc.setncattr('authors_source_script', 'Yannick Copin')
+        outnc.setncattr('url_source_script', 'http://www-pcmdi.llnl.gov/about/' +    \
+          'staff/Taylor/CV/Taylor_diagram_primer.htm')
+        ncvar.add_global_PyNCplot(outnc, 'drawing.py', fname, '1.0')
+
+        outnc.sync()
+        outnc.close()
+        print fname + ": succesful writting of file '" + ofilen + "' !!"
+
+    return
+
+
 #quit()
 
@@ -5475,6 +5733,6 @@
   'draw_2D_shad_line', 'draw_2D_shad_line_time', 'draw_2lines', 'draw_2lines_time',  \
   'draw_lines',                                                                      \
-  'draw_lines_time', 'draw_points', 'draw_topo_geogrid_boxes', 'draw_trajectories',  \
-  'draw_vals_trajectories', 'variable_values']
+  'draw_lines_time', 'draw_points', 'draw_Taylor', 'draw_topo_geogrid_boxes',        \
+  'draw_trajectories', 'draw_vals_trajectories', 'variable_values']
 
 errormsg='ERROR -- error -- ERROR -- error'
@@ -5552,4 +5810,6 @@
     elif oper == 'draw_subbasin':
         draw_subbasin(opts.ncfile, opts.values)
+    elif oper == 'draw_Taylor':
+        draw_Taylor(opts.ncfile, opts.values, opts.varname)
     elif oper == 'draw_timeSeries':
         draw_timeSeries(opts.ncfile, opts.values, opts.varname)
Index: trunk/tools/drawing_tools.py
===================================================================
--- trunk/tools/drawing_tools.py	(revision 1446)
+++ trunk/tools/drawing_tools.py	(revision 1447)
@@ -37,5 +37,5 @@
 pointsizesauto = [7.]
 
-####### Funtions
+####### Functions
 # check_colorBar: Check if the given colorbar exists in matplotlib
 # colorbar_vals: Function to provide the colorbar values for a figure
@@ -83,4 +83,5 @@
 # plot_2lines_time: Function to plot two time-lines in different axes (x/x2 or y/y2)
 # plot_lines: Function to plot a collection of lines
+# plot_Taylor: Function to draw a Taylor diagram (Taylor 2001)
 # plot_WindRose: Function to plot a wind rose (from where the dinw blows)
 # plot_ZQradii: Function to plot following radial averages only at exact grid poins
@@ -1719,6 +1720,6 @@
     fname = 'legend_values'
 
-    locleg = int(legstring.split('|')[0])
-    fontsize0 = legstring.split('|')[1]
+    locleg = int(legstring.split(char)[0])
+    fontsize0 = legstring.split(char)[1]
     if fontsize0 == 'auto':
         fontsize = 12
@@ -8394,14 +8395,5 @@
 
         # Global values
-        newnc.setncattr('author', 'L. Fita')
-        newattr = ncvar.set_attributek(newnc, 'institution', unicode('Laboratoire ' +\
-          'de M' + unichr(233) + 't' + unichr(233) + 'orologie Dynamique'), 'U')
-        newnc.setncattr('university', 'Pierre Marie Curie - Jussieu')
-        newnc.setncattr('center', 'Centre National de Recherches Scientifiques')
-        newnc.setncattr('city', 'Paris')
-        newnc.setncattr('country', 'France')
-        newnc.setncattr('script', 'nc_var_tools.py')
-        newnc.setncattr('function', fname)
-        newnc.setncattr('version', '1.0')
+        ncvar.add_global_PyNCplot(newnc, 'drawing_tools.py', fname, '1.0')
         newnc.setncattr('original_file', origfilen)
 
@@ -8411,2 +8403,202 @@
 
     return
+
+def plot_Taylor(stdv, corrv, corrpv, vunits, mtyp, mcol, msize, mlabs, labkind,      \
+  tkind, itit, kfig, closefig):
+    """ Function to draw a Taylor diagram (Taylor 2001)
+     From script:
+     # Copyright: This document has been placed in the public domain.
+
+     Taylor diagram (Taylor, 2001) test implementation.
+
+     http://www-pcmdi.llnl.gov/about/staff/Taylor/CV/Taylor_diagram_primer.htm
+
+     __version__ = "Time-stamp: <2012-02-17 20:59:35 ycopin>"
+     __author__ = "Yannick Copin <yannick.copin@laposte.net>"
+
+      stdv= standard deviation values
+      corrv= correlation values
+      corrpv= pearson correlation p-value
+      vunits= units of the variable
+      mtyp= list of type of markers
+      mcol= list of color of markers
+      msize= list of size of markers
+      mlabs= list of labels for markers (None for any)
+      labkind= kind of labels in plot
+        'markfollow': on top of the mark of each pair of stddev, corr
+        'legend',[loc],[charsize]: as a traditional legend
+      tkind: kind of Taylor plot
+        'direct': direct values
+        'norm': normalized to the stdandard deviation of reference
+      itit= title of figure
+      kfig= kind of figure
+      closefig= whether figure has to be closed or not
+    """
+    from matplotlib.projections import PolarAxes
+    import mpl_toolkits.axisartist.floating_axes as FA
+    import mpl_toolkits.axisartist.grid_finder as GF
+
+    fname = 'plot_Taylor2'
+    colelines = '#DDDDDD'
+
+    # Which size of the Taylor plot (should go until pi, since there are corr > 0.?)
+    if np.min(corrv) < 0.:
+        print warnmsg
+        print '  ' + fname + ': minimum correlation:', np.min(corrv),'is negative !!'
+        print '    extending Taylor plot until pi'
+        maxang = np.pi
+    else:
+        maxang = np.pi/2.
+
+    # Transforming correlations to given angles
+    Tcorrv = np.arccos(corrv)
+
+    plt.rc('text', usetex=True)
+    Nvalues = len(stdv)
+    colors, lines, points, Llines, Spoints = ColorsLinesPointsStyles(Nvalues,        \
+      mcol, [','], mtyp, [2], msize, None)
+
+    fig = plt.figure()
+    rect = 111
+
+    tr = PolarAxes.PolarTransform()
+
+    # Correlation labels
+    if maxang <= np.pi/2.:
+        rlocs = np.concatenate((np.arange(10)/10.,[0.95,0.99]))
+    else:
+        rlocs = np.concatenate(([-0.99, -0.95], (-10+np.arange(10))/10., [0.0],      \
+          np.arange(10)/10., [0.95,0.99], [1.]))
+
+    tlocs = np.arccos(rlocs)        # Conversion to polar angles
+    gl1 = GF.FixedLocator(tlocs)    # Positions
+    tf1 = GF.DictFormatter(dict(zip(tlocs, map(str,rlocs))))
+
+    # Standard deviation radius
+    smin = 0
+    smax = np.max([1.25*stdv[0], np.max(stdv)])
+    label = '_'
+
+    ghelper = FA.GridHelperCurveLinear(tr, extremes=(0,maxang,smin, smax),           \
+      grid_locator1=gl1, tick_formatter1=tf1)
+ 
+    ax = FA.FloatingSubplot(fig, rect, grid_helper=ghelper)
+    fig.add_subplot(ax)
+
+    # Adjust axes
+    ax.axis["top"].set_axis_direction("bottom")  # "Angle axis"
+    ax.axis["top"].toggle(ticklabels=True, label=True)
+    ax.axis["top"].major_ticklabels.set_axis_direction("top")
+    ax.axis["top"].label.set_axis_direction("top")
+    ax.axis["top"].label.set_text("Correlation")
+
+    ax.axis["left"].set_axis_direction("bottom") # "X axis"
+    ax.axis["left"].label.set_text("Standard deviation")
+
+    if maxang <= np.pi/2.:
+        ax.axis["right"].set_axis_direction("top")   # "Y axis"
+        ax.axis["right"].toggle(ticklabels=True)
+        ax.axis["right"].major_ticklabels.set_axis_direction("left")
+    else:
+        ax.axis["right"].set_axis_direction("top")   # "Y axis"
+        ax.axis["right"].toggle(ticklabels=True)
+        ax.axis["right"].major_ticklabels.set_axis_direction("bottom")
+
+    ax.axis["bottom"].set_visible(False)         # Useless
+        
+    # Contours along standard deviations
+    ax.grid(False)
+
+    ax = ax.get_aux_axes(tr)   # Polar coordinates
+
+    # Adding correlation lines
+    if maxang > np.pi/2.:
+        #thetalabs = ['1.', '0.99', '0.95', '0.9', '0.8', '0.7', '0.6', '0.5', '0.4', \
+        #  '0.3', '0.2', '0.1', '0.0', -0.1, -0.2, -0.3, -0.4, -0.5, -0.6, -0.7, -0.8,\
+        #  -0.9, -0.95, -0.99, -1.]
+        thetalabs = ['0.99', '0.95', '0.8', '0.6', '0.4', '0.2', 0.0, -0.2,  -0.4,   \
+          -0.6, -0.8, -0.95, -0.99, -1.]
+    else:
+        thetalabs = ['0.99', '0.95', '0.8', '0.6', '0.4', '0.2']
+
+    # Correlation lines
+    Nlref = 100
+    dang = maxang/(Nlref-1)
+    lref = np.zeros((Nlref,2), dtype=np.float)
+    for iang in thetalabs:
+        ang = np.arccos(np.float(iang))
+        lref[:,0] = ang
+        for ia in range(Nlref):
+            lref[ia,1] = smax*ia/(Nlref-1)
+        ax.plot(lref[:,0], lref[:,1], '--', color=colelines, linewidth=1)
+            
+    # Adding dash line from ref
+    for ia in range(Nlref):
+        lref[ia,0] = dang*ia
+        lref[ia,1] = stdv[0]
+    ax.plot(lref[:,0], lref[:,1], '-.', label='_', color='#AAAAAA', linewidth=1)
+
+    # Adding concentrical circular lines from ref
+    dang = np.pi/(Nlref-1)
+    if maxang > np.pi/2.:
+        Nlines = 8
+        rads = gen.pretty_int(0., stdv[0]*5./2.,Nlines)
+        anglab = np.pi*7./8.
+    else:
+        Nlines = 4
+        rads = gen.pretty_int(0., stdv[0]*3./2.,Nlines)
+        anglab = np.pi*1.4/2.
+
+    for rad in rads:
+        for ia in range(Nlref):
+            x = stdv[0] + rad*np.cos(dang*ia)
+            y = rad*np.sin(dang*ia)
+            if np.sqrt(x**2+y**2) <= smax:
+                lref[ia,0] = np.arctan2(y,x)
+                lref[ia,1] = np.sqrt(x**2+y**2)
+            else:
+                lref[ia,0] = None
+                lref[ia,1] = None
+
+            # Labelling distance from ref
+            if dang*ia >= anglab and dang*ia <= anglab+dang:
+                Slab = '{0:.2g}'.format(rad)
+                ax.annotate(Slab, xy=(lref[ia,0],lref[ia,1]), color='#AAAAAA')
+
+        ax.plot(lref[:,0], lref[:,1], '--', color='#AAAAAA', linewidth=0.5)
+
+    if labkind[0:6] == 'legend':
+        for iv in range(Nvalues):
+            if Nvalues != len(mlabs):
+                print errormsg
+                print '  ' + fname + ': number of vaules:', Nvalues, 'and labels:',  \
+                  len(mlabs), 'do not coincide !!'
+                print '    labels provided:', mlabs
+                quit(-1)
+            ax.plot(Tcorrv[iv], stdv[iv], lines[iv], color=colors[iv],               \
+              marker=points[iv], markersize=Spoints[iv],                             \
+              label=gen.latex_text(mlabs[iv]))
+    else:
+        for iv in range(Nvalues):
+            ax.plot(Tcorrv[iv], stdv[iv], lines[iv], color=colors[iv],               \
+              marker=points[iv], markersize=Spoints[iv])        
+
+    if labkind == 'markfollow':
+        for iv in range(Nvalues):
+            ax.annotate(gen.latex_text(mlabs[iv]), xy=(Tcorrv[iv],stdv[iv]))
+    elif labkind[0:6] == 'legend':
+        legvals = labkind.split(',')
+        gloc, gsize = legend_values(legvals[1] + ':' + legvals[2], ':')
+        ax.legend(loc=gloc, prop={'size':gsize})
+
+    fig.suptitle(gen.latex_text(itit))
+    if tkind == 'norm':
+        labstd = 'standard deviation (norm.)'
+    else:
+        labstd = 'standard deviation (' + units_lunits(vunits) + ')'
+
+    output_kind(kfig, 'Taylor', closefig)
+
+    return
+
+
