Changeset 1449 in lmdz_wrf for trunk/tools
- Timestamp:
- Feb 13, 2017, 3:43:57 PM (8 years ago)
- Location:
- trunk/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/drawing.py
r1447 r1449 3260 3260 pointsize = np.float(values.split(':')[6]) 3261 3261 labelsv = values.split(':')[7] 3262 l oclegend= values.split(':')[8]3262 legvals = values.split(':')[8] 3263 3263 figureK = values.split(':')[9] 3264 3264 … … 3319 3319 labels = labelsv.split(',') 3320 3320 3321 locleg, sizeleg = legend_values(legvals,'|') 3322 3321 3323 drw.plot_list_points(lonvals, latvals, lonname, latname, gtit, figureK, pointcolor, pointtype, \ 3322 pointsize, labels, locleg end, kindfigure, fname)3324 pointsize, labels, locleg, sizeleg, kindfigure, fname) 3323 3325 3324 3326 onc.close() … … 5464 5466 Taylor diagram (Taylor, 2001) test implementation. 5465 5467 5466 http ://www-pcmdi.llnl.gov/about/staff/Taylor/CV/Taylor_diagram_primer.htm5468 https://gist.github.com/ycopin/3342888 5467 5469 5468 5470 __version__ = "Time-stamp: <2012-02-17 20:59:35 ycopin>" -
trunk/tools/drawing_tools.py
r1447 r1449 3243 3243 return 3244 3244 3245 def plot_list_points(xval, yval, varxn, varyn, vtit, figk, color, ptk, pts, labels, lloc, kfig, figname): 3245 def plot_list_points(xval, yval, varxn, varyn, vtit, figk, color, ptk, pts, labels, \ 3246 lloc, lsiz, kfig, figname): 3246 3247 """ plotting points 3247 3248 [x/yval]: x,y values to plot 3248 3249 var[x/y]n: names of the x,y variables 3249 vtit= title of the graph ('|' for spaces)3250 vtit= title of the graph 3250 3251 figK= kind of figure 3251 3252 'legend': only points in the map with the legend with the names … … 3256 3257 labels= list of labels for the points (None, no labels) 3257 3258 lloc = localisation of the legend 3259 lsiz = font size of labels of the legend 3258 3260 kfig= kind of figure (jpg, pdf, png) 3259 3261 figname= name of the figure … … 3274 3276 for iv in range(len(xval)): 3275 3277 # 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])) 3277 3280 3278 3281 if figk[0:8] == 'labelled': … … 3280 3283 txtcol=figk.split(',')[2] 3281 3284 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) 3284 3287 elif figk == 'legend': 3285 plt.legend(loc=lloc )3288 plt.legend(loc=lloc, prop={'size':lsiz}) 3286 3289 3287 3290 else: … … 3291 3294 plt.ylabel(varyn) 3292 3295 3293 graphtit = vtit.replace('_','\_').replace('&','\&')3294 3295 plt.title(graphtit .replace('|', ' '))3296 graphtit = gen.latex_text(vtit) 3297 3298 plt.title(graphtit) 3296 3299 3297 3300 output_kind(kfig, figname, True) … … 8412 8415 Taylor diagram (Taylor, 2001) test implementation. 8413 8416 8414 http ://www-pcmdi.llnl.gov/about/staff/Taylor/CV/Taylor_diagram_primer.htm8417 https://gist.github.com/ycopin/3342888 8415 8418 8416 8419 __version__ = "Time-stamp: <2012-02-17 20:59:35 ycopin>" … … 8439 8442 import mpl_toolkits.axisartist.grid_finder as GF 8440 8443 8441 fname = 'plot_Taylor 2'8444 fname = 'plot_Taylor' 8442 8445 colelines = '#DDDDDD' 8443 8446
Note: See TracChangeset
for help on using the changeset viewer.