Changeset 1323 in lmdz_wrf for trunk/tools/generic_tools.py
- Timestamp:
- Nov 11, 2016, 8:46:15 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/generic_tools.py
r1322 r1323 10297 10297 return newmat, Lopn[opn] 10298 10298 10299 def latex_fig_array(figs, obf, figcaption, figlabel, dist='sqr', width='auto',\10300 height='None', dorest='nothing'):10299 def latex_fig_array(figs, obf, figcaption, figlabel, dist='sqr', refsize=0.9, \ 10300 width='auto', height='None', dorest='nothing'): 10301 10301 """ Function to add an array of figures to an existing tex file 10302 10302 figs= list of figures names (with path) … … 10307 10307 'sqr': squared, figures are equivenly distributed in rows and columns (sqrt(Nfigs), default) 10308 10308 [Ncol]'x'Nrow: a given number of columns and rows 10309 refsize= refernce images size (0.9, default) 10309 10310 width= with of the figures 10310 10311 'None': no value passed 10311 'auto': getting according to fractions of 0.9\textwidth (default)10312 'auto': getting according to fractions of [refsize]\textwidth (default) 10312 10313 [value]: exactly as it is desired (e.g.: '0.3\\textwidht', '5cm' ...) 10313 10314 height= height of the figures 10314 10315 'None': no value passed (default) 10315 'auto': getting according to fractions of 0.9\textheight10316 'auto': getting according to fractions of [refsize]\textheight 10316 10317 [value]: exactly as it is desired (e.g.: '0.3\\textheight', '5cm' ...) 10317 10318 dorest= what to do with the last row if it does not fill the number of columns … … 10367 10368 Nrest = np.mod(Nfig,Ncol) 10368 10369 10370 # We prefer lines of figures rather than columns 10371 if Ncol == 1 and Nrow > 1: 10372 vc = Ncol 10373 vr = Nrow 10374 Ncol = vr 10375 Nrow = vc 10376 10369 10377 print ' ' + fname + ': table of figures of: ', Ncol, 'columns', Nrow, 'rows' 10378 10379 # Checking for row/column size consistency definition 10380 if width == 'auto' and height == 'None' and Nrow > Ncol: 10381 print warnmsg 10382 print ' ' + fname + ': changing autmoatic configuration !!' 10383 print ' row-based definition of image sizes since number of rows:', Nrow, \ 10384 'is larger than the number of columns:', Ncol 10385 print " from width='auto', height='None'" 10386 print " to width='None', height='auto'" 10387 width = 'None' 10388 height = 'auto' 10370 10389 10371 10390 # Width and height section … … 10373 10392 if width != 'None': 10374 10393 if width == 'auto': 10375 sec = 0.9/Ncol10394 sec = np.float(refsize)/Ncol 10376 10395 widthheight = 'width=' + str(sec) + '\\textwidth' 10377 10396 else: … … 10381 10400 if len(widthheight) > 0: widthheight = widthheight + ', ' 10382 10401 if height == 'auto': 10383 sec = 0.9/Nrow10402 sec = np.float(refsize)/Nrow 10384 10403 widthheight = widthheight + 'height=' + str(sec) + '\\textheight' 10385 10404 else:
Note: See TracChangeset
for help on using the changeset viewer.