Changeset 587 for trunk


Ignore:
Timestamp:
Mar 19, 2012, 10:23:14 AM (13 years ago)
Author:
aslmd
Message:

UTIL PYTHON : added cycling through linestyles. note also that -T for 1D plots now adds crosses but does not make the line disappear.

Location:
trunk/UTIL/PYTHON
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTIL/PYTHON/myplot.py

    r583 r587  
    756756    #print "NEW MIN ", min(what_I_plot)
    757757    what_I_plot[ what_I_plot > 9e+35  ] = -9e+35
    758     what_I_plot[ what_I_plot > zevmax ] = zevmax
     758    what_I_plot[ what_I_plot > zevmax ] = zevmax*(1. - 1.e-7)
    759759    #print "NEW MAX ", max(what_I_plot)
    760760    return what_I_plot
  • trunk/UTIL/PYTHON/planetoplot.py

    r582 r587  
    8686    import subprocess
    8787    #from singlet import singlet
     88    from itertools import cycle
    8889
    8990#########################
     
    214215                 indices[iii,jjj,:] = bidimfind(lon2d,lat2d,vlon,vlat,file=iwantawhereplot) 
    215216                 lonp,latp = ( lon2d[indices[iii,jjj,0],indices[iii,jjj,1]] , lat2d[indices[iii,jjj,0],indices[iii,jjj,1]] )
     217              ### possible bug here if several --lat
    216218              for iii in range(numlon):
    217219               for jjj in range(numlat):
     
    344346    ### Time loop for plotting device
    345347    nplot = 1 ; error = False
     348    linecycler = cycle(["-","--","-.",":"])
    346349    print "********************************************"
    347350    while error is False:
     
    423426               if mapmode == 0:    ### could this be moved inside imov loop ?
    424427                   itime=indextime
    425                    if len(what_I_plot.shape) is 3: itime=[0]
     428                   if len(what_I_plot.shape) == 3: itime=[0]
    426429                   m = None ; x = None ; y = None
    427430                   what_I_plot, x, y = define_axis(lon,lat,vert,time,indexlon,indexlat,indexvert,\
     
    491494                        if mrate is not None: x = y  ## because swapaxes...
    492495                        #what_I_plot_frame = np.diff(what_I_plot_frame, n=1) ; x = x[1:]
    493                        
    494                         if not tile:  zeline='-'
    495                         else:         zeline=','
     496                     
     497                        zeline = next(linecycler) ## "-" for simple lines
     498                        if tile:      zemarker = 'x'
     499                        else:         zemarker = None
    496500                        this_is_a_regular_plot = (indexvert is not None) or (indextime is None) or (indexlat is None) or (indexlon is None)
    497                         if this_is_a_regular_plot:   plot(x,what_I_plot_frame,zeline,label=lbl)  ## vertical profile
    498                         else:                        plot(what_I_plot_frame,x,zeline,label=lbl)  ## regular plot
     501                        if this_is_a_regular_plot:   plot(x,what_I_plot_frame,zeline,label=lbl,marker=zemarker)  ## vertical profile
     502                        else:                        plot(what_I_plot_frame,x,zeline,label=lbl,marker=zemarker)  ## regular plot
    499503                        if nplot > 1: legend(loc='best')
    500504                        if indextime is None and axtime is not None and xlab is None:    xlabel(axtime.upper()) ## define the right label
Note: See TracChangeset for help on using the changeset viewer.