Changeset 1120 in lmdz_wrf
- Timestamp:
- Sep 30, 2016, 3:41:47 PM (9 years ago)
- Location:
- trunk/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/tools/drawing.py ¶
r1119 r1120 56 56 draw_2D_shad(ncfile, values, varn) 57 57 ncfile= file to use 58 values=[vnamefs]:[dimvals]:[dimxvn]:[dimyvn]:[colorbar]:[ sminv],[smaxv]:[figt]:58 values=[vnamefs]:[dimvals]:[dimxvn]:[dimyvn]:[colorbar]:[fmtcolorbar]:[sminv],[smaxv]:[figt]: 59 59 [kindfig]:[reverse]:[mapv]:[close] 60 60 [vnamefs]: Name in the figure of the variable to be shaded … … 62 62 variable a given value is required (-1, all the length) 63 63 [dimx/yvn]: name of the variables with the values of the final dimensions (x,y) 64 [colorbar]: name of the color bar 64 [colbarn]: name of the color bar 65 [fmtcolorbar]: format of the numbers in the color bar 'C'-like ('auto' for %6g) 65 66 [smin/axv]: minimum and maximum value for the shading or: 66 67 'Srange': for full range … … 100 101 quit() 101 102 102 expectargs = '[vnamefs]:[dimvals]:[dimxvn]:[dimyvn]:[col orbar]:[sminv],[smaxv]'+\103 ' :[figt]:[kindfig]:[reverse]:[mapv]:[close]'103 expectargs = '[vnamefs]:[dimvals]:[dimxvn]:[dimyvn]:[colbarn]:[fmtcolorbar]:' + \ 104 '[sminv],[smaxv]:[figt]:[kindfig]:[reverse]:[mapv]:[close]' 104 105 105 106 drw.check_arguments(fname,values,expectargs,':') … … 110 111 vdimyn = values.split(':')[3] 111 112 colbarn = values.split(':')[4] 112 shadminmax = values.split(':')[5] 113 figtitle = values.split(':')[6].replace('|',' ') 114 figkind = values.split(':')[7] 115 revals = values.split(':')[8] 116 mapvalue = values.split(':')[9] 117 close = gen.Str_Bool(values.split(':')[10]) 113 fmtcolbar0 = values.split(':')[5] 114 shadminmax = values.split(':')[6] 115 figtitle = values.split(':')[7].replace('|',' ') 116 figkind = values.split(':')[8] 117 revals = values.split(':')[9] 118 mapvalue = values.split(':')[10] 119 close = gen.Str_Bool(values.split(':')[11]) 118 120 119 121 ncfiles = ncfile … … 222 224 if mapvalue == 'None': mapvalue = None 223 225 226 if fmtcolbar0 == 'auto': 227 fmtcolorbar = '%6g' 228 else: 229 fmtcolorbar = fmtcolbar0 230 224 231 drw.plot_2D_shadow(valshad, vnamesfig, odimxv, odimyv, odimxu, odimyu, dimnamesv,\ 225 colbarn, shading_nx, varunits, figtitle, figkind, revals, mapvalue, close) 232 colbarn, fmtcolorbar, shading_nx, varunits, figtitle, figkind, revals, \ 233 mapvalue, close) 226 234 227 235 return -
TabularUnified trunk/tools/drawing_tools.py ¶
r1119 r1120 3777 3777 3778 3778 def plot_2D_shadow(varsv,vnames,dimxv,dimyv,dimxu,dimyu,dimn, \ 3779 colorbar, vs,uts,vtit,kfig,reva,mapv,ifclose):3779 colorbar,cbarfmt,vs,uts,vtit,kfig,reva,mapv,ifclose): 3780 3780 """ Adding labels and other staff to the graph 3781 3781 varsv= 2D values to plot with shading … … 3785 3785 dimn= dimension names to plot 3786 3786 colorbar= name of the color bar to use 3787 cbarfmt= format of the numbers in the colorbar 3787 3788 vs= minmum and maximum values to plot in shadow or: 3788 3789 'Srange': for full range … … 4000 4001 4001 4002 plt.pcolormesh(x, y, varsv, cmap=plt.get_cmap(colorbar), vmin=vsend[0], vmax=vsend[1]) 4002 cbar = plt.colorbar( )4003 cbar = plt.colorbar(format=cbarfmt) 4003 4004 4004 4005 if not mapv is None:
Note: See TracChangeset
for help on using the changeset viewer.