Changeset 562 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
Jul 6, 2015, 12:06:08 PM (10 years ago)
Author:
lfita
Message:

Adding `degrees' in 'units_lunits'
Adding no-legend option on 'draw_lines_time'

Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/drawing.py

    r561 r562  
    18031803        [valuesaxis]: which axis will be used for the values ('x', or 'y')
    18041804        [dimtit]: title for the common dimension ('|' for spaces)
    1805         [leglabels]: ',' separated list of names for the legend
     1805        [leglabels]: ',' separated list of names for the legend ('None', no legend)
    18061806        [vartit]: name of the variable in the graph
    18071807        [title]: title of the plot ('|' for spaces)
     
    20032003    timepos, timelabels = drw.CFtimes_plot(tvals, timeunit, timekind, timefmt)
    20042004
    2005     drw.plot_lines_time(dimvalues, varvalues, valuesaxis, dimtit, leglabels.split(','),   \
    2006       vartit, varunits, timepos, timelabels, title, locleg, graphk, collines)
    2007 
     2005    if leglabels.find(',') != -1:
     2006      drw.plot_lines_time(dimvalues, varvalues, valuesaxis, dimtit,                  \
     2007        leglabels.split(','), vartit, varunits, timepos, timelabels, title, locleg,  \
     2008        graphk, collines)
     2009    else:
     2010      drw.plot_lines_time(dimvalues, varvalues, valuesaxis, dimtit,                  \
     2011        None, vartit, varunits, timepos, timelabels, title, locleg, graphk, collines)
    20082012    return
    20092013
  • trunk/tools/drawing_tools.py

    r560 r562  
    14451445
    14461446# Units which does not change
    1447     same = ['1', 'category', 'day', 'deg', 'degrees East', 'degrees Nord',           \
     1447    same = ['1', 'category', 'day', 'deg', 'degrees', 'degrees East', 'degrees Nord',\
    14481448      'degrees North', 'g', 'gpm', 'hour', 'hPa', 'K', 'Km', 'kg', 'km', 'm',        \
    14491449      'minute', 'mm', 'month', 'Pa', 's', 'second', 'um', 'year', '-']
     
    51945194    return
    51955195
    5196 def plot_lines_time(vardv, varvv, vaxis, dtit, linesn, vtit, vunit, tpos, tlabs,     \
     5196def plot_lines_time(vardv, varvv, vaxis, dtit, linesn0, vtit, vunit, tpos, tlabs,    \
    51975197  gtit, gloc, kfig, coll):
    51985198    """ Function to plot a collection of lines with a time axis
     
    52015201      vaxis= which axis will be used for the time values ('x', or 'y')
    52025202      dtit= title for the common dimension
    5203       linesn= names for the legend
     5203      linesn= names for the legend (None, no legend)
    52045204      vtit= title for the vaxis
    52055205      vunit= units of the vaxis
     
    52345234    xtrmdv = [fillValueF,-fillValueF]
    52355235
     5236# Do we have legend?
     5237##
     5238    if linesn0 is None:
     5239        linesn = []
     5240        for itrj in range(Ntraj):
     5241            linesn = str(itrj)
     5242    else:
     5243        linesn = linesn0
     5244
    52365245    if vaxis == 'x':
    52375246        for il in range(Ntraj):
     
    52965305
    52975306    plt.title(graphtit)
    5298     plt.legend(loc=gloc)
     5307    if linesn0 is not None:
     5308        plt.legend(loc=gloc)
    52995309
    53005310    print plt.xlim(),':', plt.ylim()
Note: See TracChangeset for help on using the changeset viewer.