Changeset 1441 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
Feb 8, 2017, 10:02:54 PM (8 years ago)
Author:
lfita
Message:

Fixing last marker on `linepoints' in 'multicol', 'multicoltime'
Adding extra variable name and 'units_lunits' at the barplot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/drawing_tools.py

    r1438 r1441  
    80598059        'anglespeedfreq';[Nang];[Nspeed];[maxspeed];[cbar];[maxfreq] grid of frequencies of each angle and speed
    80608060          following a given discretization
    8061         'linepoint';[kind];[val1];[...;[valN]]: consecutive (time, height, level, ...) line-point angle and speed valules
     8061        'linepoint';[kind];[val1];[...;[valN]]: consecutive (time, height, level, ...) line-point angle and speed values
    80628062          'multicol';[extravarn];[line];[marker];[colbar]
    80638063          'multicoltime';[extravarn];[line];[marker];[colbar];[timekind];[timefmt];[timelabel]
     
    82228222                labcol = my_cmap(norm(ev[ie]))
    82238223                plt.plot([ang[ie], ang[ie+1]], [speed[ie], speed[ie+1]], ltyp, marker=lmrk, color=labcol)
     8224
     8225            ie = dime-1
     8226            labcol = my_cmap(norm(ev[ie]))
     8227            lcolS = gen.coldec_hex(labcol[0:3])
     8228            plt.plot(ang[ie], speed[ie], ltyp, marker=lmrk, color=lcolS)
     8229
    82248230            # FROM: http://stackoverflow.com/questions/8342549/matplotlib-add-colorbar-to-a-sequence-of-line-plots
    82258231            # For matplotlib v1.3 or greater the code becomes:
     
    82288234            sm._A = []
    82298235            cbar = plt.colorbar(sm)
    8230             cbar.set_label(eunit)
     8236            cbar.set_label(lpvals[2] + ' (' + units_lunits(eunit) + ')')
     8237
    82318238        elif lkind == 'multicoltime':
    82328239            ltyp = gen.auto_val(lpvals[3],'-')
     
    82488255                lcolS = gen.coldec_hex(labcol[0:3])
    82498256                plt.plot([ang[ie], ang[ie+1]], [speed[ie], speed[ie+1]], ltyp, marker=lmrk, color=lcolS)
     8257
     8258            ie = dime-1
     8259            labcol = my_cmap(norm(ev[ie]))
     8260            lcolS = gen.coldec_hex(labcol[0:3])
     8261            plt.plot(ang[ie], speed[ie], ltyp, marker=lmrk, color=lcolS)
    82508262   
    82518263            # FROM: http://stackoverflow.com/questions/8342549/matplotlib-add-colorbar-to-a-sequence-of-line-plots
     
    82838295            plt.scatter(ang, speed, c=ev, cmap=colbar, marker=lmrk)
    82848296            cbar = plt.colorbar()
    8285             cbar.set_label(eunit)
     8297            cbar.set_label(lpvals[2] + ' (' + units_lunits(eunit) + ')')
    82868298        elif lkind == 'multicoltime':
    82878299            lmrk = gen.auto_val(lpvals[3],'x')
Note: See TracChangeset for help on using the changeset viewer.