Changeset 2203
- Timestamp:
- Apr 7, 2016 12:30:16 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIplot.py
r2201 r2203 518 518 Page.figure.clf() 519 519 Plot = Page.figure.gca() #get a fresh plot after clf() 520 #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab520 G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab 521 521 except ValueError: 522 522 Plot = G2frame.G2plotNB.addMpl('Structure Factors').gca() … … 1120 1120 plotNum = G2frame.G2plotNB.plotList.index('3D Structure Factors') 1121 1121 Page = G2frame.G2plotNB.nb.GetPage(plotNum) 1122 #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab1122 G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab 1123 1123 except ValueError: 1124 1124 Plot = G2frame.G2plotNB.addOgl('3D Structure Factors') … … 1638 1638 Page.figure.clf() 1639 1639 Plot = Page.figure.gca() #get a fresh plot after clf() 1640 #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab1640 G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab 1641 1641 except ValueError: 1642 1642 if plottype == 'SASD': … … 2105 2105 Page.figure.clf() 2106 2106 Plot = Page.figure.gca() #get a fresh plot after clf() 2107 #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab2107 G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab 2108 2108 except ValueError: 2109 2109 newPlot = True … … 2252 2252 Page.figure.clf() 2253 2253 Plot = Page.figure.gca() 2254 #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab2254 G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab 2255 2255 except ValueError: 2256 2256 newPlot = True … … 2408 2408 Page.figure.clf() 2409 2409 Plot = Page.figure.gca() 2410 #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab2410 G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab 2411 2411 except ValueError: 2412 2412 newPlot = True … … 2489 2489 Page.figure.clf() 2490 2490 Plot = Page.figure.gca() 2491 #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab2491 G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab 2492 2492 except ValueError: 2493 2493 newPlot = True … … 2597 2597 Page.figure.clf() 2598 2598 Plot = Page.figure.gca() 2599 #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab2599 G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab 2600 2600 except ValueError: 2601 2601 newPlot = True … … 2668 2668 Page.figure.clf() 2669 2669 Plot = Page.figure.gca() 2670 #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab2670 G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab 2671 2671 except ValueError: 2672 2672 newPlot = True … … 2726 2726 Page.figure.clf() 2727 2727 Plot = Page.figure.gca() #get a fresh plot after clf() 2728 #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab2728 G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab 2729 2729 except ValueError: 2730 2730 newPlot = True … … 2765 2765 if xpos: #avoid out of frame mouse position 2766 2766 Page.canvas.SetCursor(wx.CROSS_CURSOR) 2767 G2frame.G2plotNB.status.Set Fields(['','2-theta =%9.3f '%(xpos,)])2767 G2frame.G2plotNB.status.SetStatusText('2-theta =%9.3f '%(xpos,),1) 2768 2768 if G2frame.PickId and G2frame.PatternTree.GetItemText(G2frame.PickId) in ['Index Peak List','Unit Cells List']: 2769 2769 found = [] … … 2783 2783 Page.figure.clf() 2784 2784 Plot = Page.figure.gca() 2785 #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab2785 G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab 2786 2786 except ValueError: 2787 2787 Plot = G2frame.G2plotNB.addMpl('Powder Lines').gca() … … 2854 2854 Page.figure.clf() 2855 2855 Plot = Page.figure.gca() 2856 #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab2856 G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab 2857 2857 except ValueError: 2858 2858 Plot = G2frame.G2plotNB.addMpl('Peak Widths').gca() … … 3190 3190 y,x,z = list(xyz/np.max(np.abs(xyz))) 3191 3191 3192 G2frame.G2plotNB.status.SetFields(['', 3193 'psi =%9.3f, beta =%9.3f, MRD =%9.3f hkl=%5.2f,%5.2f,%5.2f'%(r,p,ipf,x,y,z)]) 3194 #G2frame.G2plotNB.status.SetStatusWidths([150,-1]) 3192 G2frame.G2plotNB.status.SetStatusText( 3193 'psi =%9.3f, beta =%9.3f, MRD =%9.3f hkl=%5.2f,%5.2f,%5.2f'%(r,p,ipf,x,y,z),1) 3195 3194 3196 3195 elif 'Axial' in SHData['PlotType']: … … 3206 3205 r,p = 2.*npatand(z),npatan2d(ypos,xpos) 3207 3206 pf = G2lat.polfcal(ODFln,SamSym[textureData['Model']],np.array([r,]),np.array([p,])) 3208 G2frame.G2plotNB.status.SetFields(['','phi =%9.3f, gam =%9.3f, MRD =%9.3f'%(r,p,pf)]) 3209 #G2frame.G2plotNB.status.SetStatusWidths([150,-1]) 3207 G2frame.G2plotNB.status.SetStatusText('phi =%9.3f, gam =%9.3f, MRD =%9.3f'%(r,p,pf),1) 3210 3208 3211 3209 try: … … 3216 3214 if not Page.IsShown(): 3217 3215 Page.Show() 3218 #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab3216 G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab 3219 3217 except ValueError: 3220 3218 if '3D' in SHData['PlotType']: … … 3229 3227 G2frame.G2plotNB.RaisePageNoRefresh(Page) 3230 3228 G2frame.G2plotNB.status.SetFields(['','']) 3229 G2frame.G2plotNB.status.SetStatusWidths([150,-1]) 3231 3230 PH = np.array(SHData['PFhkl']) 3232 3231 phi,beta = G2lat.CrsAng(PH,cell,SGData) … … 3372 3371 if not Page.IsShown(): 3373 3372 Page.Show() 3374 #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab3373 G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab 3375 3374 except ValueError: 3376 3375 Plot = G2frame.G2plotNB.addMpl('Modulation').gca() … … 3468 3467 title = ' for\n'+Data['title'] 3469 3468 newAtomDict = Data.get('newAtomDict',{}) 3470 # G2frame.G2plotNB.Delete('Covariance')3471 3469 G2frame.G2plotNB.status.DestroyChildren() 3472 3470 … … 3505 3503 msg = '%s - %s: %5.3f'%(varyList[xpos],varyList[ypos],covArray[xpos][ypos]) 3506 3504 Page.canvas.SetToolTipString(msg) 3507 G2frame.G2plotNB.status.SetFields(['',msg]) 3508 #for some reason this needs to be here - otherwise in later wx's width gets changed 3509 #G2frame.G2plotNB.status.SetStatusWidths([150,-1]) 3505 G2frame.G2plotNB.status.SetStatusText(msg,1) 3510 3506 3511 3507 try: … … 3516 3512 if not Page.IsShown(): 3517 3513 Page.Show() 3518 #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab3514 G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab 3519 3515 except ValueError: 3520 3516 Plot = G2frame.G2plotNB.addMpl('Covariance').gca() … … 3526 3522 Page.keyPress = OnPlotKeyPress 3527 3523 G2frame.G2plotNB.RaisePageNoRefresh(Page) 3528 G2frame.G2plotNB.status.SetFields(['','']) 3524 G2frame.G2plotNB.status.SetFields(['','']) 3525 G2frame.G2plotNB.status.SetStatusWidths([150,-1]) #need to reset field widths here 3529 3526 acolor = mpl.cm.get_cmap(G2frame.VcovColor) 3530 3527 Img = Plot.imshow(covArray,aspect='equal',cmap=acolor,interpolation='nearest',origin='lower', … … 3586 3583 if not Page.IsShown(): 3587 3584 Page.Show() 3588 #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab3585 G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab 3589 3586 except ValueError: 3590 3587 Plot = G2frame.G2plotNB.addMpl('Torsion').gca() … … 3595 3592 3596 3593 G2frame.G2plotNB.RaisePageNoRefresh(Page) 3597 G2frame.G2plotNB.status.Set Fields(['','Use mouse LB to identify torsion atoms'])3594 G2frame.G2plotNB.status.SetStatusText('Use mouse LB to identify torsion atoms',1) 3598 3595 Plot.plot(X,torsion,'b+') 3599 3596 if len(Coeff): … … 3670 3667 if not Page.IsShown(): 3671 3668 Page.Show() 3672 #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab3669 G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab 3673 3670 except ValueError: 3674 3671 Plot = G2frame.G2plotNB.addMpl('Ramachandran').gca() … … 3682 3679 Page.keyPress = OnPlotKeyPress 3683 3680 G2frame.G2plotNB.RaisePageNoRefresh(Page) 3684 G2frame.G2plotNB.status.Set Fields(['','Use mouse LB to identify phi/psi atoms'])3681 G2frame.G2plotNB.status.SetStatusText('Use mouse LB to identify phi/psi atoms',1) 3685 3682 acolor = mpl.cm.get_cmap(G2frame.RamaColor) 3686 3683 if RamaName == 'All' or '-1' in RamaName: … … 4080 4077 polygon.append([x0,y0]) 4081 4078 G2frame.MaskKey = '' 4082 G2frame.G2plotNB.status.Set Fields(['','Polygon closed'])4079 G2frame.G2plotNB.status.SetStatusText('Polygon closed',) 4083 4080 else: 4084 G2frame.G2plotNB.status.Set Fields(['','New polygon point: %.1f,%.1f'%(Xpos,Ypos)])4081 G2frame.G2plotNB.status.SetStatusText('New polygon point: %.1f,%.1f'%(Xpos,Ypos),1) 4085 4082 polygon.append([Xpos,Ypos]) 4086 4083 elif G2frame.MaskKey =='f': … … 4090 4087 frame.append([x0,y0]) 4091 4088 G2frame.MaskKey = '' 4092 G2frame.G2plotNB.status.Set Fields(['','Frame closed'])4089 G2frame.G2plotNB.status.SetStatusText('Frame closed',1) 4093 4090 else: 4094 G2frame.G2plotNB.status.Set Fields(['','New frame point: %.1f,%.1f'%(Xpos,Ypos)])4091 G2frame.G2plotNB.status.SetStatusText('New frame point: %.1f,%.1f'%(Xpos,Ypos),1) 4095 4092 frame.append([Xpos,Ypos]) 4096 4093 G2imG.UpdateMasks(G2frame,Masks) … … 4453 4450 tth = event.xdata 4454 4451 if azm and tth: 4455 G2frame.G2plotNB.status.Set Fields(\4456 ['','Detector 2-th =%9.3fdeg, azm = %7.2fdeg'%(tth,azm)])4452 G2frame.G2plotNB.status.SetStatusText(\ 4453 'Detector 2-th =%9.3fdeg, azm = %7.2fdeg'%(tth,azm),1) 4457 4454 4458 4455 try: … … 4521 4518 tth = event.ydata 4522 4519 if azm and tth: 4523 G2frame.G2plotNB.status.Set Fields(\4524 ['','Detector 2-th =%9.3fdeg, azm = %7.2fdeg'%(tth,azm)])4520 G2frame.G2plotNB.status.SetStatusText(\ 4521 'Detector 2-th =%9.3fdeg, azm = %7.2fdeg'%(tth,azm),1) 4525 4522 4526 4523 try: … … 4532 4529 Page.figure.clf() 4533 4530 Plot = Page.figure.gca() #get a fresh plot after clf() 4534 #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab4531 G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab 4535 4532 4536 4533 except ValueError: … … 5638 5635 plotNum = G2frame.G2plotNB.plotList.index(generalData['Name']) 5639 5636 Page = G2frame.G2plotNB.nb.GetPage(plotNum) 5640 #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab5637 G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab 5641 5638 except ValueError: 5642 5639 Plot = G2frame.G2plotNB.addOgl(generalData['Name']) … … 5941 5938 plotNum = G2frame.G2plotNB.plotList.index('Rigid body') 5942 5939 Page = G2frame.G2plotNB.nb.GetPage(plotNum) 5943 #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab5940 G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab 5944 5941 except ValueError: 5945 5942 Plot = G2frame.G2plotNB.addOgl('Rigid body') … … 6325 6322 plotNum = G2frame.G2plotNB.plotList.index('Layer') 6326 6323 Page = G2frame.G2plotNB.nb.GetPage(plotNum) 6327 #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab6324 G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab 6328 6325 except ValueError: 6329 6326 Plot = G2frame.G2plotNB.addOgl('Layer')
Note: See TracChangeset
for help on using the changeset viewer.