Ignore:
Timestamp:
Oct 25, 2012, 11:24:38 PM (12 years ago)
Author:
aslmd
Message:

UTIL PYTHON : improved projections. improved local time ticks. small bug fix with vertical coordinates. added a keyword nocolorb.

File:
1 edited

Legend:

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

    r792 r817  
    7676           trycol=False,\
    7777           streamflag=False,\
     78           nocolorb=False,\
    7879           analysis=None):
    7980
     
    429430    ### Open a figure and set subplots
    430431    fig = figure()
    431     subv,subh = definesubplot( numplot, fig )
     432    subv,subh = definesubplot( numplot, fig, ipreferline = (mapmode == 1) )
    432433    if ope in ['-','-%','-_histo'] and len(namefiles) ==1 : subv,subh = 2,2
    433434    elif ope in ['-','-%'] and len(namefiles)>1 : subv, subh = len(namefiles), 3
     
    464465       ltst = None
    465466       if typefile in ['meso'] and indextime is not None and len(indextime) < 2: ltst = localtime ( indextime, slon , all_namefile[index_f])
     467
     468
     469       #if mapmode == 0:
     470       # if xlab is None:
     471       #  if indexlon is None:  xlab = "Longitude"
     472       #  elif indexlat is None: xlab = "Latitude"
     473       # if ylab is None:
     474       #  if indexvert is None: ylab = "Altitude"
     475
     476
    466477       print "********** INDEX LON:",indexlon," LAT:",indexlat," VERT:",indexvert," TIME:",indextime
    467478       ##var = nc.variables["phisinit"][:,:]
     
    547558               else:                                                   palette = get_cmap(name=colorb)
    548559               #palette = cm.GMT_split
     560               #palette = cm.GMT_globe
    549561               ##### 1. ELIMINATE 0D or >3D CASES
    550562               if len(what_I_plot.shape) == 0:   
     
    618630                        if indextime is None and axtime is not None and xlab is None:    xlabel(axtime.upper()) ## define the right label
    619631                        if save == 'txt':  writeascii(np.transpose([x,np.transpose(what_I_plot)]),'profile'+str(nplot*1000+imov)+'.txt')
    620 
     632                        if axtime == "lt":
     633                            ax = mpl.pyplot.gca()
     634                            # set ticks where your images will be
     635                            ax.get_xaxis().set_ticks(np.arange(0,48,2))
     636                            # rename tick labels
     637                            ax.get_xaxis().set_ticklabels(["0","2","4","6","8","10","12","14","16","18","20","22",\
     638                                                       "0","2","4","6","8","10","12","14","16","18","20","22"])
     639                            ## rebound everyone
     640                            ax.set_xbound(lower=min(x), upper=max(x))
    621641                    elif which == "xy":
    622642                        if lbls is not None: lbl=lbls[index_f]
     
    707727                            mpl.pyplot.plot([idx],[idy],'+k',mew=0.5,ms=18)
    708728
    709                         if colorb not in ['nobar','onebar']:       
     729                        if not nocolorb:
     730                          if colorb not in ['nobar','onebar']:
    710731                            if (fileref is not None) and ((index_f+1)%3 == 0):   daformat = "%.3f"
    711732                            elif mult != 1:                                        daformat = "%.1f"
Note: See TracChangeset for help on using the changeset viewer.