Changeset 1449 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
Feb 13, 2017, 3:43:57 PM (8 years ago)
Author:
lfita
Message:

Fixing right url for the source of the Taylor diagram from Yannick Copin

Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/drawing.py

    r1447 r1449  
    32603260    pointsize = np.float(values.split(':')[6])
    32613261    labelsv = values.split(':')[7]
    3262     loclegend = values.split(':')[8]
     3262    legvals = values.split(':')[8]
    32633263    figureK = values.split(':')[9]
    32643264
     
    33193319        labels = labelsv.split(',')
    33203320
     3321    locleg, sizeleg = legend_values(legvals,'|')
     3322
    33213323    drw.plot_list_points(lonvals, latvals, lonname, latname, gtit, figureK, pointcolor, pointtype,    \
    3322       pointsize, labels, loclegend, kindfigure, fname)
     3324      pointsize, labels, locleg, sizeleg, kindfigure, fname)
    33233325
    33243326    onc.close()
     
    54645466     Taylor diagram (Taylor, 2001) test implementation.
    54655467
    5466      http://www-pcmdi.llnl.gov/about/staff/Taylor/CV/Taylor_diagram_primer.htm
     5468     https://gist.github.com/ycopin/3342888
    54675469
    54685470     __version__ = "Time-stamp: <2012-02-17 20:59:35 ycopin>"
  • trunk/tools/drawing_tools.py

    r1447 r1449  
    32433243    return
    32443244
    3245 def plot_list_points(xval, yval, varxn, varyn, vtit, figk, color, ptk, pts, labels, lloc, kfig, figname):
     3245def plot_list_points(xval, yval, varxn, varyn, vtit, figk, color, ptk, pts, labels,  \
     3246  lloc, lsiz, kfig, figname):
    32463247    """ plotting points
    32473248      [x/yval]: x,y values to plot
    32483249      var[x/y]n: names of the x,y variables
    3249       vtit= title of the graph ('|' for spaces)
     3250      vtit= title of the graph
    32503251      figK= kind of figure
    32513252        'legend': only points in the map with the legend with the names
     
    32563257      labels= list of labels for the points (None, no labels)
    32573258      lloc = localisation of the legend
     3259      lsiz = font size of labels of the legend
    32583260      kfig= kind of figure (jpg, pdf, png)
    32593261      figname= name of the figure
     
    32743276        for iv in range(len(xval)):
    32753277#            print iv,xval[iv],yval[iv],labels[iv],ptkinds[N7pts]
    3276             plt.plot(xval[iv],yval[iv], ptk, markersize=pts, label=labels[iv])
     3278            plt.plot(xval[iv],yval[iv], ptk, markersize=pts,                         \
     3279              gen.latex_text(label=labels[iv]))
    32773280
    32783281        if figk[0:8] == 'labelled':
     
    32803283            txtcol=figk.split(',')[2]
    32813284            for iv in range(len(xval)):
    3282                 plt.annotate(labels[iv], xy=(xval[iv],yval[iv]), xycoords='data',    \
    3283                   fontsize=txtsize, color=txtcol)
     3285                plt.annotate(gen.latex_text(labels[iv]), xy=(xval[iv],yval[iv]),     \
     3286                  xycoords='data', fontsize=txtsize, color=txtcol)
    32843287        elif figk == 'legend':
    3285             plt.legend(loc=lloc)
     3288            plt.legend(loc=lloc, prop={'size':lsiz})
    32863289
    32873290    else:
     
    32913294    plt.ylabel(varyn)
    32923295
    3293     graphtit = vtit.replace('_','\_').replace('&','\&')
    3294 
    3295     plt.title(graphtit.replace('|', ' '))
     3296    graphtit = gen.latex_text(vtit)
     3297
     3298    plt.title(graphtit)
    32963299   
    32973300    output_kind(kfig, figname, True)
     
    84128415     Taylor diagram (Taylor, 2001) test implementation.
    84138416
    8414      http://www-pcmdi.llnl.gov/about/staff/Taylor/CV/Taylor_diagram_primer.htm
     8417     https://gist.github.com/ycopin/3342888
    84158418
    84168419     __version__ = "Time-stamp: <2012-02-17 20:59:35 ycopin>"
     
    84398442    import mpl_toolkits.axisartist.grid_finder as GF
    84408443
    8441     fname = 'plot_Taylor2'
     8444    fname = 'plot_Taylor'
    84428445    colelines = '#DDDDDD'
    84438446
Note: See TracChangeset for help on using the changeset viewer.