Changeset 502 for trunk/UTIL/PYTHON/planetoplot.py
- Timestamp:
- Jan 23, 2012, 5:04:36 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/planetoplot.py
r494 r502 59 59 zarea=None,\ 60 60 axtime=None,\ 61 redope=None): 61 redope=None,\ 62 xlab=None,\ 63 ylab=None): 62 64 63 65 … … 74 76 from mymath import deg,max,min,mean,get_tsat,writeascii,fig2data,fig2img 75 77 import matplotlib as mpl 76 from matplotlib.pyplot import contour,contourf, subplot, figure, rcParams, savefig, colorbar, pcolor, show, plot, clabel, title, close, legend, xlabel, axis 78 from matplotlib.pyplot import contour,contourf, subplot, figure, rcParams, savefig, colorbar, pcolor, show, plot, clabel, title, close, legend, xlabel, axis, ylabel 77 79 from matplotlib.cm import get_cmap 78 80 #from mpl_toolkits.basemap import cm … … 265 267 if ope == "-": all_var[k+1]= all_var[k-1] - all_var[k] 266 268 elif ope == "+": all_var[k+1]= all_var[k-1] + all_var[k] 267 elif ope == "-%": all_var[k+1]= 100.*(all_var[k-1] + all_var[k])/all_var[k] 269 elif ope == "-%": 270 masked = np.ma.masked_where(all_var[k] == 0,all_var[k]) 271 masked.set_fill_value([np.NaN]) 272 all_var[k+1]= 100.*(all_var[k-1] - masked)/masked 268 273 all_varname[k+1] = all_varname[k] ; all_time[k+1] = all_time[k] ; all_namefile[k+1] = all_namefile[k] ; numplot = numplot+2 269 274 elif ope in ["cat"]: … … 440 445 else: plot(what_I_plot_frame,x,label=lbl) ## vertical profile 441 446 if nplot > 1: legend(loc='best') 442 if indextime is None and axtime is not None :xlabel(axtime.upper()) ## define the right label447 if indextime is None and axtime is not None and xlab is None: xlabel(axtime.upper()) ## define the right label 443 448 if save == 'txt': writeascii(np.transpose(what_I_plot),'profile'+str(nplot*1000+imov)+'.txt') 444 449 … … 498 503 if ylog: mpl.pyplot.semilogy() 499 504 if invert_y: ax = mpl.pyplot.gca() ; ax.set_ylim(ax.get_ylim()[::-1]) 505 if xlab is not None: xlabel(xlab) 506 if ylab is not None: ylabel(ylab) 500 507 501 508 if mrate is not None:
Note: See TracChangeset
for help on using the changeset viewer.