Changeset 1573 in lmdz_wrf for trunk/tools/drawing_tools.py
- Timestamp:
- May 12, 2017, 9:25:55 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/drawing_tools.py
r1559 r1573 9897 9897 ifclose= whether figure should be closed 9898 9898 """ 9899 from scipy import stats as sts 9899 9900 fname = 'plot_time_lag' 9900 9901 9901 9902 Nvalues = len(prevals) 9902 9903 9903 dxn = gen.fillValue 9904 dxx = -gen.fillValue 9905 dyn = gen.fillValue 9906 dyx = -gen.fillValue 9907 9908 for iv in range(Nvalues): 9909 minv = np.min(prevals[iv]) 9910 maxv = np.max(prevals[iv]) 9911 if minv < dxn: dxn = minv 9912 if maxv > dxx: dxx = maxv 9913 minv = np.min(futvals[iv]) 9914 maxv = np.max(futvals[iv]) 9915 if minv < dyn: dyn = minv 9916 if maxv > dyx: dyx = maxv 9904 dxn = prerange[0] 9905 dxx = prerange[1] 9906 dyn = futrange[0] 9907 dyx = futrange[1] 9917 9908 9918 9909 axstyles = ['pretty', 'Nfix', 'Stringlist', 'Vfix'] … … 10073 10064 10074 10065 Nlag = int(figv[1]) 10075 col = gen.str_list_rep(figv[2],'@',Nvalues) 10066 if figv[2] == 'auto': 10067 col = colorsauto 10068 else: 10069 col = gen.str_list_rep(figv[2],'@',Nvalues) 10076 10070 mark = gen.str_list_rep(figv[3],'@',Nvalues) 10077 10071 size = gen.str_list_rep(figv[4],'@',Nvalues) … … 10083 10077 plt.plot(xvs[0:dimt-Nlag], yvs[Nlag:dimt], ',', color=col[iv], \ 10084 10078 marker=mark[iv], markersize=size[iv]) 10079 # Computing correlation 10080 corr, p_value = sts.pearsonr(xvs[0:dimt-Nlag], yvs[Nlag:dimt]) 10081 txt='corr= ' + '{0:.3g}'.format(corr) + ' p: ' + '{0:.2g}'.format(p_value) 10082 plt.annotate(txt,xy=(0.95,0.05*(Nvalues-iv)), xycoords='figure fraction',\ 10083 color=col[iv], fontsize=lsiz, horizontalalignment='right') 10085 10084 else: 10086 10085 print errormsg
Note: See TracChangeset
for help on using the changeset viewer.