Changeset 1334 in lmdz_wrf


Ignore:
Timestamp:
Nov 15, 2016, 9:00:20 PM (9 years ago)
Author:
lfita
Message:

Working copy of `draw_2d_shaw_cont' without need of flip@y for z-figures!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/drawing_tools.py

    r1288 r1334  
    45384538    dyx = dimyv.max()
    45394539
     4540
     4541    # sens of the original x-axis and y-axis
     4542    xneg=False
     4543    if dimxv0[0] > dimxv0[1]: xneg=True
     4544    yneg=False
     4545    if dimyv0[0] > dimyv0[1]: yneg=True
     4546
    45404547    if xaxv[0] == 'pretty':
    45414548        dimxt0 = np.array(gen.pretty_int(dxn,dxx,xaxv[2]))
     4549        axxtype='data'
    45424550    elif xaxv[0] == 'Nfix':
    4543         dimxt0 = np.arange(0.,1.,1./xaxv[2])
     4551        dimxt0 = np.arange(0.,1.,1./(xaxv[2]+1))
    45444552        dimxv0 = np.arange(0.,1.,1./varsv.shape[1])
     4553        axxtype='fixpixel'
    45454554    elif xaxv[0] == 'Vfix':
    4546         dimxt0 = np.arange(0,dxx,xaxv[2])
     4555        dxnvfix = int(dxn/xaxv[2])
     4556        dimxt0 = np.arange(dxnvfix*xaxv[2],dxx,xaxv[2])
     4557        axxtype='data'
    45474558    if yaxv[0] == 'pretty':
    45484559        dimyt0 = np.array(gen.pretty_int(dyn,dyx,yaxv[2]))
     4560        axytype='data'
    45494561    elif yaxv[0] == 'Nfix':
    4550         dimyt0 = np.arange(0.,1.,1./yaxv[2])
     4562        dimyt0 = np.arange(0.,1.,1./(yaxv[2]+1))
    45514563        dimyv0 = np.arange(0.,1.,1./varsv.shape[0])
     4564        axytype='fixpixel'
    45524565    elif yaxv[0] == 'Vfix':
    4553         dimyt0 = np.arange(0,dyx,yaxv[2])
     4566        dynvfix = int(dyn/yaxv[2])
     4567        dimyt0 = np.arange(dynvfix*xaxv[2],dyx,yaxv[2])
     4568        axytype='data'
     4569
     4570    if xneg: dimxt0 = dimxt0[::-1]
     4571    if yneg: dimyt0 = dimyt0[::-1]
    45544572
    45554573    dimxl0 = []
     
    45764594        varsv, dimxv, dimyv, dimxt, dimyt, dimxl, dimyl, dimxT, dimyT =              \
    45774595          transform(varsv, reva, dxv=dimxv0, dyv=dimyv0, dxt=dimxt0, dyt=dimyt0,     \
    4578           dxl=dimxl0, dyl=dimyl0, dxtit=dimxT0, dytit=dimyT0)
     4596          dxl=dimxl0, dyl=dimyl0, dxtit=dimxT0, dytit=dimyT0, axxkind=axxtype,       \
     4597          axykind=axytype)
    45794598    else:
    45804599        dimxv = dimxv0
     
    47214740        plt.yticks(dimyt, dimyl, rotation=yaxv[3])
    47224741
    4723 # set the limits of the plot to the limits of the data
    4724 #    plt.axis([x.min(), x.max(), y.min(), y.max()])
     4742    #set the limits of the plot to the limits of the data
     4743    plt.axis([x[0,0], x[0,x.shape[1]-1], y[0,0], y[y.shape[0]-1,0]])
    47254744
    47264745
Note: See TracChangeset for help on using the changeset viewer.