Changeset 1326 in lmdz_wrf for trunk


Ignore:
Timestamp:
Nov 11, 2016, 10:25:29 PM (8 years ago)
Author:
lfita
Message:

Adding `latex_fig_array' on 'generic.py'

Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/generic.py

    r1222 r1326  
    1515import generic_tools as gen
    1616
    17 main = 'generic_tools.py'
     17main = 'generic.py'
    1818errormsg = 'ERROR -- error -- ERROR -- error'
    1919warnmsg = 'WARNING -- warning --WARNING -- warning'
     
    5050operations=['coincident_CFtimes', 'count_cond', 'datetimeStr_conversion',            \
    5151  'grid_combinations',                                                               \
    52   'interpolate_locs', 'list_operations', 'PolyArea',                                 \
     52  'interpolate_locs', 'latex_fig_array', 'list_operations', 'PolyArea',              \
    5353  'radial_points', 'radius_dist',                                                    \
    5454  'rmNOnum', 'running_mean',                                                         \
     
    172172        print gen.grid_combinations(np.int(vals[0]), np.int(vals[1]))
    173173
     174elif oper == 'latex_fig_array':
     175    vals = opts.values.split(cS)
     176    if vals[0] == 'h':
     177        print gen.latex_fig_array.__doc__
     178        print "  NOTE: first argument as existing LaTeX file"
     179        print "  figs: passing list of figures as '@' separated list"
     180        print "  caption: using '!' for spaces"
     181        quit(-1)
     182    else:
     183        expectargs = '[latexfile],[figs],[figcaption],[figlabel],[dist],[refsize],'+ \
     184         '[width],[height],[dorest]'
     185        gen.check_arguments(oper,opts.values,expectargs,cS)
     186
     187        objf = open(vals[0], 'a')
     188
     189        figs = vals[1].split('@')
     190        caption = vals[2].replace('!',' ')
     191        gen.latex_fig_array(figs, objf, caption, vals[3], dist=vals[4],              \
     192          refsize=vals[5], width=vals[6], height=vals[7], dorest=vals[8])
     193        objf.write('\\end{document}\n')
     194        objf.close()
     195 
    174196elif oper == 'interpolate_locs':
    175197    Nvals = 3
  • trunk/tools/generic_tools.py

    r1324 r1326  
    1032010320        'center': center the figures
    1032110321    >>> latex_fig_array(['figs/figA.png','figs/figB.png','figs/figC.png','figs/figD.png','figs/figE.png'], \
    10322       objf, 'figure test', 'fig:test', dist='2x3', width='None', height='auto', dorest='center')
     10322    objf, 'figure test', 'fig:test', dist='2x3', width='None', height='auto', dorest='center')
    1032310323    \begin{figure}
    1032410324    \begin{center}
Note: See TracChangeset for help on using the changeset viewer.