Changeset 641
- Timestamp:
- Apr 30, 2012, 3:51:36 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/planetoplot.py
r640 r641 581 581 if ope == '-' and nplot == numplot: # this should work as long as ope is '-' guarantees 3 plots for 4 panels without contour 582 582 subplot(subv,subh,nplot+1) 583 latmin = -50.; latmax = 50. # latitude range for histogram of difference584 if indexlat is None: # a bit dirty, if field is not reduced along latitude, we assume lat is along the y axis583 if indexlat is None: 584 latmin = -50.; latmax = 50. # latitude range for histogram of difference 585 585 zeindexlat = (lat<latmax)*(lat>latmin) 586 what_I_plot_frame = what_I_plot_frame[zeindexlat,:] 586 if (len(lat) == len(x)) and (len(lat) == len(y)): errormess('PLANETOPLOT.PY: I cant find which axis is lat for histogram.') 587 elif len(lat) == len(x) : what_I_plot_frame = what_I_plot_frame[:,zeindexlat] 588 elif len(lat) == len(y) : what_I_plot_frame = what_I_plot_frame[zeindexlat,:] 589 else: errormess('PLANETOPLOT.PY: indexlat is None, but I cant find the lat axis.') 587 590 toplot = np.ravel(what_I_plot_frame[np.isnan(what_I_plot_frame)==False]) 588 zebins = np.linspace( minop,maxop,num=30)591 zebins = np.linspace(zevmin,zevmax,num=30) 589 592 hist(toplot,bins=zebins,histtype='step',linewidth=2,color='k',normed=True) 590 593 zestd = np.std(toplot) 591 594 zemean = np.mean(toplot) 592 zebins = np.linspace( minop,maxop,num=300)595 zebins = np.linspace(zevmin,zevmax,num=300) 593 596 zegauss = (1./(zestd * np.sqrt(2 * np.pi)) * np.exp( - (zebins - zemean)**2 / (2 * zestd**2) ) ) 594 597 text(zebins[2],np.max(zegauss),'mean: '+str(zemean)[0:5]+'\nstd: '+str(zestd)[0:5],fontsize = 12)
Note: See TracChangeset
for help on using the changeset viewer.