Changeset 1119 in lmdz_wrf
- Timestamp:
- Sep 29, 2016, 5:04:28 PM (9 years ago)
- Location:
- trunk/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/drawing.py
r1118 r1119 52 52 'draw_vectors', 'draw_vertical_levels', 'list_graphics', 'variable_values'] 53 53 54 def draw_2D_shad(ncfile, values, varn ):54 def draw_2D_shad(ncfile, values, varn, axfig=None, fig=None): 55 55 """ plotting a fields with shading 56 56 draw_2D_shad(ncfile, values, varn) … … 89 89 * 'h', high 90 90 * 'f', full 91 [close]: Whether figure should be finished or not 91 92 valules= 'rh:z|-1,x|-1:z|-1,x|-1:lat:pressure:BuPu:0.,100.:rh:pdf:flip@y:None' 92 93 varn= [varsn] name of the variable to plot with shading … … 114 115 revals = values.split(':')[8] 115 116 mapvalue = values.split(':')[9] 116 # varn = values.split(':')[10] 117 close = gen.Str_Bool(values.split(':')[10]) 117 118 118 119 ncfiles = ncfile … … 222 223 223 224 drw.plot_2D_shadow(valshad, vnamesfig, odimxv, odimyv, odimxu, odimyu, dimnamesv,\ 224 colbarn, shading_nx, varunits, figtitle, figkind, revals, mapvalue, True)225 colbarn, shading_nx, varunits, figtitle, figkind, revals, mapvalue, close) 225 226 226 227 return -
trunk/tools/drawing_tools.py
r1117 r1119 2552 2552 quit() 2553 2553 2554 if kindf == 'null':2555 print 'showing figure...'2556 plt.show()2557 elif kindf == 'gif':2558 plt.savefig(namef + ".gif")2559 if close: print "Successfully generation of figure '" + namef + ".jpg' !!!"2560 elif kindf == 'jpg':2561 plt.savefig(namef + ".jpg")2562 if close: print "Successfully generation of figure '" + namef + ".jpg' !!!"2563 elif kindf == 'pdf':2564 plt.savefig(namef + ".pdf")2565 if close: print "Successfully generation of figure '" + namef + ".pdf' !!!"2566 elif kindf == 'png':2567 plt.savefig(namef + ".png")2568 if close: print "Successfully generation of figure '" + namef + ".png' !!!"2569 elif kindf == 'ps':2570 plt.savefig(namef + ".ps")2571 if close: print "Successfully generation of figure '" + namef + ".ps' !!!"2572 else:2573 print errormsg2574 print ' ' + fname + ' output format: "' + kindf + '" not ready !!'2575 print errormsg2576 quit(-1)2577 2578 2554 if close: 2555 if kindf == 'null': 2556 print 'showing figure...' 2557 plt.show() 2558 elif kindf == 'gif': 2559 plt.savefig(namef + ".gif") 2560 if close: print "Successfully generation of figure '" + namef + ".jpg' !!!" 2561 elif kindf == 'jpg': 2562 plt.savefig(namef + ".jpg") 2563 if close: print "Successfully generation of figure '" + namef + ".jpg' !!!" 2564 elif kindf == 'pdf': 2565 plt.savefig(namef + ".pdf") 2566 if close: print "Successfully generation of figure '" + namef + ".pdf' !!!" 2567 elif kindf == 'png': 2568 plt.savefig(namef + ".png") 2569 if close: print "Successfully generation of figure '" + namef + ".png' !!!" 2570 elif kindf == 'ps': 2571 plt.savefig(namef + ".ps") 2572 if close: print "Successfully generation of figure '" + namef + ".ps' !!!" 2573 else: 2574 print errormsg 2575 print ' ' + fname + ' output format: "' + kindf + '" not ready !!' 2576 print errormsg 2577 quit(-1) 2578 2579 2579 plt.close() 2580 2580 … … 3933 3933 vsend = np.zeros((2), dtype=np.float) 3934 3934 # Changing limits of the colors 3935 if type(vs[0]) != type(np.float(1.)) :3935 if type(vs[0]) != type(np.float(1.)) and type(vs[0]) != type(np.float64(1.)): 3936 3936 if vs[0] == 'Srange': 3937 3937 vsend[0] = np.min(varsv)
Note: See TracChangeset
for help on using the changeset viewer.