Changeset 204 in lmdz_wrf for trunk/tools/drawing.py


Ignore:
Timestamp:
Dec 9, 2014, 5:30:58 PM (10 years ago)
Author:
lfita
Message:

Adding legend position in 'draw_lines_time'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/drawing.py

    r203 r204  
    15781578    draw_lines_time(ncfilens, values, varname):
    15791579      ncfilens= [filen] ',' separated list of netCDF files
    1580       values= [dimvname];[valuesaxis];[dimtit];[leglabels];[vtit];[title];[timevals];[graphk]
     1580      values= [dimvname];[valuesaxis];[dimtit];[leglabels];[vtit];[title];[timevals];[locleg];[graphk]
    15811581        [dimvname]: name of the variable with he values of the common dimension
    15821582        [valuesaxis]: which axis will be used for the values ('x', or 'y')
     
    15961596                'l': milisecond
    15971597           [tfmt]; desired format
     1598        [locleg]: location of the legend (-1, autmoatic)
     1599          1: 'upper right', 2: 'upper left', 3: 'lower left', 4: 'lower right',
     1600          5: 'right', 6: 'center left', 7: 'center right', 8: 'lower center',
     1601          9: 'upper center', 10: 'center'
    15981602        [graphk]: kind of the graphic
    15991603      varname= variable to plot
    1600       values= 'time;y;time ([DD]${[HH]}$);32x32;$wss^{*}$;wss Taylor's turbulence term;time|hours!since!1949-12-01_00:00:00;exct,12,h|%d$^{%H}$;pdf'
     1604      values= 'time;y;time ([DD]${[HH]}$);32x32;$wss^{*}$;wss Taylor's turbulence term;time|hours!since!1949-12-01_00:00:00;exct,12,h|%d$^{%H}$;2;pdf'
    16011605    """
    16021606
     
    16091613
    16101614    expectargs = '[dimvname];[valuesaxis];[dimtit];[leglabels];[vtit];[title];'
    1611     expectargs = expectargs + '[timevals];[graphk]'
     1615    expectargs = expectargs + '[timevals];[locleg];[graphk]'
    16121616    drw.check_arguments(fname,len(expectargs.split(';')),values,';',expectargs)
    16131617
     
    16201624    title = values.split(';')[5].replace('|',' ')
    16211625    timevals = values.split(';')[6]
    1622     graphk = values.split(';')[7]
     1626    locleg = int(values.split(';')[7])
     1627    graphk = values.split(';')[8]
    16231628
    16241629    Nfiles = len(ncfiles)
     
    17021707
    17031708    drw.plot_lines_time(dimvalues, varvalues, valuesaxis, dimtit, leglabels.split(','),   \
    1704       vartit, varunits, timepos, timelabels, title, graphk)
     1709      vartit, varunits, timepos, timelabels, title, locleg, graphk)
    17051710
    17061711    return
Note: See TracChangeset for help on using the changeset viewer.