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


Ignore:
Timestamp:
Jan 28, 2016, 1:38:11 PM (9 years ago)
Author:
lfita
Message:

Adding linewithds and linepoints on `ColorsLinesPointsStyles?'
Adding `markerevery' on 'plot_lines_time'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/drawing.py

    r684 r687  
    18131813      ncfilens= [filen] ',' separated list of netCDF files
    18141814      values= [dimvname];[valuesaxis];[dimtit];[leglabels];[vtit];[title];[timevals];[locleg];
    1815         [graphk];[collines];[points];[pointfreq];[period]
     1815        [graphk];[collines];[points];[linewidths];[pointsizes];[pointfreq];[period]
    18161816        [dimvname]: ',' list of names of the variables with he values of the common dimension
    18171817        [valuesaxis]: which axis will be used for the values ('x', or 'y')
     
    18411841        [points]: ',' list of type of points for the lines, None for automatic, single
    18421842          value all the same
     1843        [linewidths]: ',' list of widths for the lines, None for automatic, single
     1844          value all the same
     1845        [pointsizes]: ',' list of widths for the lines, None for automatic, single
     1846          value all the same
    18431847        [pointfreq]: frequency of point plotting, 'all' for all time steps
    18441848        [period]: which period to plot
     
    18581862    expectargs = '[dimvname];[valuesaxis];[dimtit];[leglabels];[vtit];[title];'
    18591863    expectargs = expectargs + '[timevals];[locleg];[graphk];[lines];[collines];[points];'
    1860     expectargs = expectargs + '[pointfreq];[period]'
     1864    expectargs = expectargs + '[linewidths];[pointsizes];[pointfreq];[period]'
    18611865    drw.check_arguments(fname,len(expectargs.split(';')),values,';',expectargs)
    18621866
     
    18741878    collines0 = values.split(';')[10]
    18751879    points0 = values.split(';')[11]
    1876     pointfreq0 = values.split(';')[12]
    1877     period = values.split(';')[13]
     1880    linewidths0 = values.split(';')[12]
     1881    pointsizes0 = values.split(';')[13]
     1882    pointfreq0 = values.split(';')[14]
     1883    period = values.split(';')[15]
    18781884
    18791885    Nfiles = len(ncfiles)
     
    19041910    if collines0.find(',') != -1:
    19051911        collines = collines0.split(',')
    1906     elif collines == 'None':
     1912    elif collines0 == 'None':
    19071913        collines = None
    19081914    else:
     
    19201926        for ip in range(Nfiles):
    19211927            points.append(points0)
     1928
     1929# Multiple line sizes?
     1930    if linewidths0.find(',') != -1:
     1931        linewidths = []
     1932        Nlines = len(linewidths0.split(','))
     1933        for il in Nlines:
     1934          linewidths.append(np.float(linewidths0.split(',')[il]))
     1935    elif linewidths0 == 'None':
     1936        linewidths = None
     1937    else:
     1938        linewidths = [np.float(linewidths0)]
     1939
     1940# Multiple point sizes?
     1941    if pointsizes0.find(',') != -1:
     1942        pointsizes = []
     1943        Npts = len(pointsizes0.split(','))
     1944        for ip in Npts:
     1945          pointsizes.append(np.float(pointsizes0.split(',')[ip]))
     1946    elif pointsizes0 == 'None':
     1947        pointsizes = None
     1948    else:
     1949        pointsizes = [np.float(pointsizes0)]
    19221950
    19231951# Getting values
     
    20622090    drw.plot_lines_time(dimvalues, varvalues, valuesaxis, dimtit, legvals, vartit,   \
    20632091      varunits, timepos, timelabels, title, locleg, graphk, lines, collines, points, \
    2064       pointfreq)
     2092      linewidths, pointsizes, pointfreq)
    20652093
    20662094    return
Note: See TracChangeset for help on using the changeset viewer.