Changeset 1334 in lmdz_wrf
- Timestamp:
- Nov 15, 2016, 9:00:20 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/drawing_tools.py
r1288 r1334 4538 4538 dyx = dimyv.max() 4539 4539 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 4540 4547 if xaxv[0] == 'pretty': 4541 4548 dimxt0 = np.array(gen.pretty_int(dxn,dxx,xaxv[2])) 4549 axxtype='data' 4542 4550 elif xaxv[0] == 'Nfix': 4543 dimxt0 = np.arange(0.,1.,1./ xaxv[2])4551 dimxt0 = np.arange(0.,1.,1./(xaxv[2]+1)) 4544 4552 dimxv0 = np.arange(0.,1.,1./varsv.shape[1]) 4553 axxtype='fixpixel' 4545 4554 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' 4547 4558 if yaxv[0] == 'pretty': 4548 4559 dimyt0 = np.array(gen.pretty_int(dyn,dyx,yaxv[2])) 4560 axytype='data' 4549 4561 elif yaxv[0] == 'Nfix': 4550 dimyt0 = np.arange(0.,1.,1./ yaxv[2])4562 dimyt0 = np.arange(0.,1.,1./(yaxv[2]+1)) 4551 4563 dimyv0 = np.arange(0.,1.,1./varsv.shape[0]) 4564 axytype='fixpixel' 4552 4565 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] 4554 4572 4555 4573 dimxl0 = [] … … 4576 4594 varsv, dimxv, dimyv, dimxt, dimyt, dimxl, dimyl, dimxT, dimyT = \ 4577 4595 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) 4579 4598 else: 4580 4599 dimxv = dimxv0 … … 4721 4740 plt.yticks(dimyt, dimyl, rotation=yaxv[3]) 4722 4741 4723 #set the limits of the plot to the limits of the data4724 # 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]]) 4725 4744 4726 4745
Note: See TracChangeset
for help on using the changeset viewer.