Changeset 2118 in lmdz_wrf


Ignore:
Timestamp:
Aug 31, 2018, 12:23:06 AM (7 years ago)
Author:
lfita
Message:

Adding number of columns in legend of `draw_lines_time'

Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/drawing.py

    r2117 r2118  
    24132413                'l': milisecond
    24142414           [tfmt]; desired format
    2415         [legvals]=[locleg]|[fontsize]:
     2415        [legvals]=[locleg]|[fontsize]|[Ncols]
    24162416          [locleg]: location of the legend (0, autmoatic)
    24172417            1: 'upper right', 2: 'upper left', 3: 'lower left', 4: 'lower right',
     
    24192419            9: 'upper center', 10: 'center'
    24202420          [fontsize]: font size for the legend (auto for 12)
     2421          [Ncols]: number of columns in the legend
    24212422        [graphk]: kind of the output of the graphic ('png', 'pdf', 'eps', ...)
    24222423        [lines]: ',' list of type of lines (matplotlib syntax), 'None' for automatic,
     
    25602561
    25612562    # Legend
    2562     locleg, legfontsize = drw.legend_values(legvals,'|')
    2563     legconf = [locleg, legfontsize]
     2563    locleg, legfontsize, Ncols = drw.legend_values(legvals,'|')
     2564    legconf = [locleg, legfontsize, Ncols]
    25642565
    25652566# Getting values
  • trunk/tools/drawing_tools.py

    r2105 r2118  
    65216521      vmin= minimum value for the axis-value 'auto' for use the extreme
    65226522      vmax= maximum value for the axis-value 'auto' for use the extreme
    6523       legv = [gloc, gsize] legend values
     6523      legv = [gloc, gsize, Ncol] legend values
    65246524        gloc= location of the legend (0, autmoatic)
    65256525          1: 'upper right', 2: 'upper left', 3: 'lower left', 4: 'lower right',
     
    65276527          9: 'upper center', 10: 'center'
    65286528        gsize= fontsize of the legend
     6529        Ncol= number of columns
    65296530      trng= actual range of time values [tmin, tmax]
    65306531      kfig= kind of figure
     
    67086709    plt.title(graphtit)
    67096710    if linesn0 is not None:
    6710         print 'Lluis: legv:', legv
    6711         plt.legend(loc=legv[0], prop={'size':legv[1]})
     6711        plt.legend(loc=legv[0], prop={'size':legv[1]}, ncol=legv[2])
    67126712
    67136713    output_kind(kfig, figname, ifclose)
Note: See TracChangeset for help on using the changeset viewer.