Changeset 620 in lmdz_wrf for trunk/tools/drawing_tools.py


Ignore:
Timestamp:
Aug 21, 2015, 3:26:11 PM (10 years ago)
Author:
lfita
Message:

Adding 'points' as paramter on 'draw_lines_time'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/drawing_tools.py

    r605 r620  
    52055205
    52065206def plot_lines_time(vardv, varvv, vaxis, dtit, linesn0, vtit, vunit, tpos, tlabs,    \
    5207   gtit, gloc, kfig, coll):
     5207  gtit, gloc, kfig, coll, ptl):
    52085208    """ Function to plot a collection of lines with a time axis
    52095209      vardv= list of set of dimension values
     
    52235223      kfig= kind of figure
    52245224      coll= ',' list of colors for the lines or None for automatic
     5225      coll= ',' list of colors for the lines, None for automatic, single
     5226          value all the same
     5227      ptl= ',' list of type of points for the lines, None for automatic, single
     5228          value all the same
     5229
    52255230      plot_lines([np.arange(10)], [np.sin(np.arange(10)*np.pi/2.5)], 'y', 'time (s)',      \
    52265231  ['2.5'], 'sin', '-', 'sinus frequency dependency', 'pdf')
     
    52345239
    52355240# Canging line kinds every 7 lines (end of standard colors)
    5236     linekinds=['.-','x-','o-']
     5241    linekinds = []
     5242    if ptl is None:
     5243        linekindsauto=['.-','x-','o-']
     5244        for ptype in range(4):
     5245            for ip in range(7):
     5246                linekinds.append(linekindsauto[ptype])
     5247    else:
     5248        linekinds = ptl
    52375249
    52385250    Ntraj = len(vardv)
     
    52565268        for il in range(Ntraj):
    52575269            if coll is None:
    5258                 plt.plot(varvv[il], vardv[il], linekinds[N7lines], label= linesn[il])
     5270                plt.plot(varvv[il], vardv[il], linekinds[il], label= linesn[il])
    52595271            else:
    5260                 plt.plot(varvv[il], vardv[il], linekinds[N7lines], label= linesn[il],\
     5272                plt.plot(varvv[il], vardv[il], linekinds[il], label= linesn[il],\
    52615273                  color=coll[il])
    52625274
     
    52705282            if mindv < xtrmdv[0]: xtrmdv[0] = mindv
    52715283            if maxdv > xtrmdv[1]: xtrmdv[1] = maxdv
    5272 
    5273             if il == 6: N7lines = N7lines + 1
    52745284
    52755285        plt.xlabel(vtit + ' (' + vunit + ')')
     
    52845294        for il in range(Ntraj):
    52855295            if coll is None:
    5286                 plt.plot(vardv[il], varvv[il], linekinds[N7lines], label= linesn[il])
     5296                plt.plot(vardv[il], varvv[il], linekinds[il], label= linesn[il])
    52875297            else:
    5288                 plt.plot(vardv[il], varvv[il], linekinds[N7lines], label= linesn[il],\
     5298                plt.plot(vardv[il], varvv[il], linekinds[il], label= linesn[il],\
    52895299                  color=coll[il])
    52905300
     
    52985308            if mindv < xtrmdv[0]: xtrmdv[0] = mindv
    52995309            if maxdv > xtrmdv[1]: xtrmdv[1] = maxdv
    5300 
    5301             if il == 6: N7lines = N7lines + 1
    53025310
    53035311        plt.xlabel(dtit)
Note: See TracChangeset for help on using the changeset viewer.