Changeset 1205 for trunk/GSASIIplot.py
- Timestamp:
- Jan 23, 2014 3:15:51 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIplot.py
r1204 r1205 401 401 newPlot = False 402 402 if event.key == 'w' and 'PWDR' in plottype: 403 if G2frame.Weight: 404 G2frame.Weight = False 405 else: 406 G2frame.Weight = True 403 G2frame.ErrorBars = not G2frame.ErrorBars 404 if not G2frame.Weight: 407 405 G2frame.SinglePlot = True 408 406 newPlot = True 407 elif event.key == 'e' and 'SASD' in plottype: 408 G2frame.ErrorBars = not G2frame.ErrorBars 409 409 elif event.key == 'b' and 'PWDR' in plottype: 410 if G2frame.SubBack: 411 G2frame.SubBack = False 412 else: 413 G2frame.SubBack = True 410 G2frame.SubBack = not G2frame.SubBack 411 if not G2frame.SubBack: 414 412 G2frame.SinglePlot = True 415 413 elif event.key == 'n': … … 417 415 pass 418 416 else: 419 if G2frame.logPlot: 420 G2frame.logPlot = False 421 else: 417 G2frame.logPlot = not G2frame.logPlot 418 if not G2frame.logPlot: 422 419 G2frame.Offset[0] = 0 423 G2frame.logPlot = True424 420 newPlot = True 425 421 elif event.key == 'u': 426 422 if G2frame.Contour: 427 423 G2frame.Cmax = min(1.0,G2frame.Cmax*1.2) 428 elif G2frame.logPlot:429 pass430 424 elif G2frame.Offset[0] < 100.: 431 425 G2frame.Offset[0] += 1. … … 433 427 if G2frame.Contour: 434 428 G2frame.Cmax = max(0.0,G2frame.Cmax*0.8) 435 elif G2frame.logPlot:436 pass437 429 elif G2frame.Offset[0] > 0.: 438 430 G2frame.Offset[0] -= 1. … … 442 434 G2frame.Offset[1] += 1. 443 435 elif event.key == 'o': 436 G2frame.Cmax = 1.0 444 437 G2frame.Offset = [0,0] 445 438 elif event.key == 'c': 446 439 newPlot = True 447 if G2frame.Contour: 448 G2frame.Contour = False 449 else: 450 G2frame.Contour = True 440 G2frame.Contour = not G2frame.Contour 441 if not G2frame.Contour: 451 442 G2frame.SinglePlot = False 452 443 G2frame.Offset = [0.,0.] 453 elif event.key == 'q' and 'PWDR' in plottype: 454 newPlot = True 455 if G2frame.qPlot: 456 G2frame.qPlot = False 457 else: 458 G2frame.qPlot = True 444 elif event.key == 'q': 445 if 'PWDR' in plottype: 446 newPlot = True 447 G2frame.qPlot = not G2frame.qPlot 448 elif 'SASD' in plottype: 449 newPlot = True 450 G2frame.sqPlot = not G2frame.sqPlot 459 451 elif event.key == 's': 460 452 if G2frame.Contour: … … 468 460 G2frame.ContourColor = 'Paired' 469 461 dlg.Destroy() 470 else: 471 if G2frame.SinglePlot: 472 G2frame.SinglePlot = False 473 else: 474 G2frame.SinglePlot = True 462 else: 463 G2frame.SinglePlot = not G2frame.SinglePlot 475 464 newPlot = True 476 465 elif event.key == '+': 477 466 if G2frame.PickId: 478 467 G2frame.PickId = False 479 elif event.key == 'i' : #for smoothing contour plot468 elif event.key == 'i' and G2frame.Contour: #for smoothing contour plot 480 469 choice = ['nearest','bilinear','bicubic','spline16','spline36','hanning', 481 470 'hamming','hermite','kaiser','quadric','catrom','gaussian','bessel', … … 690 679 G2frame.G2plotNB.status.DestroyChildren() 691 680 if G2frame.Contour: 692 Page.Choice = (' key press','d: lower contour max','u: raise contour max', 681 Page.Choice = (' key press','d: lower contour max','u: raise contour max','o: reset contour max', 693 682 'i: interpolation method','s: color scheme','c: contour off') 694 683 else: 695 684 if G2frame.logPlot: 696 Page.Choice = (' key press','n: log(I) off','l: offset left','r: offset right', 697 'c: contour on','q: toggle q plot','s: toggle single plot','+: no selection') 685 if 'PWDR' in plottype: 686 Page.Choice = (' key press','n: log(I) off','l: offset left','r: offset right','o: reset offset', 687 'c: contour on','q: toggle q plot','s: toggle single plot','+: no selection') 688 elif 'SASD' in plottype: 689 Page.Choice = (' key press','n: log(I) off','l: offset left','r: offset right', 690 'd: offset down','u: offset up','o: reset offset','q: toggle S(q) plot', 691 'c: contour on','s: toggle single plot','+: no selection') 698 692 else: 699 693 if 'PWDR' in plottype: … … 702 696 'q: toggle q plot','s: toggle single plot','w: toggle divide by sig','+: no selection') 703 697 elif 'SASD' in plottype: 704 Page.Choice = (' key press',' l: offset left','r: offset right','d: offset down',698 Page.Choice = (' key press','e: toggle error bars','l: offset left','r: offset right','d: offset down', 705 699 'u: offset up','o: reset offset','n: log(I) on','c: contour on', 706 700 's: toggle single plot','+: no selection') … … 779 773 Plot.set_ylabel('$Intensity$',fontsize=16) 780 774 elif 'SASD' in plottype: 781 Plot.set_ylabel('$Intensity, cm^{-1}$',fontsize=16) 775 if G2frame.sqPlot: 776 Plot.set_ylabel('$S(Q)=I*Q^{4}$',fontsize=16) 777 else: 778 Plot.set_ylabel('$Intensity, cm^{-1}$',fontsize=16) 782 779 else: 783 780 Plot.set_ylabel('Normalized intensity',fontsize=16) … … 820 817 Y = xye[1]+offset*N 821 818 elif 'SASD' in plottype: 822 Y = xye[1]*Sample['Scale'][0]+offset*N 819 if G2frame.logPlot: 820 if G2frame.sqPlot: 821 Y = xye[1]*Sample['Scale'][0]*(1.005)**(offset*N)*X**4 822 else: 823 Y = xye[1]*Sample['Scale'][0]*(1.005)**(offset*N) 824 else: 825 Y = xye[1]*Sample['Scale'][0]+offset*N 823 826 if LimitId and ifpicked: 824 827 limits = np.array(G2frame.PatternTree.GetItemPyData(LimitId)) … … 843 846 Plot.set_ylabel('Data sequence',fontsize=12) 844 847 else: 845 X += G2frame.Offset[1]*.005*N 848 if 'SASD' in plottype and G2frame.logPlot: 849 X *= (1.01)**(G2frame.Offset[1]*N) 850 else: 851 X += G2frame.Offset[1]*.005*N 846 852 Xum = ma.getdata(X) 847 853 if ifpicked: … … 854 860 if G2frame.logPlot: 855 861 if 'PWDR' in plottype: 856 Plot.semilogy(X,Y,colors[N%6]+'+',picker=3.,clip_on=False,nonposy='mask') 857 Plot.semilogy(X,Z,colors[(N+1)%6],picker=False,nonposy='mask') 858 Plot.semilogy(X,W,colors[(N+2)%6],picker=False,nonposy='mask') 862 Plot.set_yscale("log",nonposy='mask') 863 Plot.plot(X,Y,colors[N%6]+'+',picker=3.,clip_on=False) 864 Plot.plot(X,Z,colors[(N+1)%6],picker=False) 865 Plot.plot(X,W,colors[(N+2)%6],picker=False) 859 866 elif 'SASD' in plottype: 860 Plot.loglog(X,Y,colors[N%6]+'+',picker=3.,clip_on=False,nonposy='mask') 861 Plot.loglog(X,Z,colors[(N+1)%6],picker=False,nonposy='mask') 862 elif G2frame.Weight: 867 Plot.set_xscale("log",nonposx='mask') 868 Plot.set_yscale("log",nonposy='mask') 869 if G2frame.ErrorBars: 870 Plot.errorbar(X,Y,yerr=np.sqrt(1./xye[2]),ecolor=colors[N%6],picker=3.,clip_on=False) 871 else: 872 Plot.plot(X,Y,colors[N%6]+'+',picker=3.,clip_on=False) 873 Plot.plot(X,Z,colors[(N+1)%6],picker=False) 874 elif G2frame.Weight and 'PWDR' in plottype: 863 875 DY = xye[1]*np.sqrt(xye[2]) 864 876 DYmax = max(DY) … … 1058 1070 elif event.key == 'c': 1059 1071 newPlot = True 1060 if G2frame.Contour: 1061 G2frame.Contour = False 1062 else: 1063 G2frame.Contour = True 1072 G2frame.Contour = not G2frame.Contour 1073 if not G2frame.Contour: 1064 1074 G2frame.SinglePlot = False 1065 1075 G2frame.Offset = [0.,0.] … … 1075 1085 G2frame.ContourColor = 'Paired' 1076 1086 dlg.Destroy() 1077 else: 1078 if G2frame.SinglePlot: 1079 G2frame.SinglePlot = False 1080 else: 1081 G2frame.SinglePlot = True 1087 else: 1088 G2frame.SinglePlot = not G2frame.SinglePlot 1082 1089 elif event.key == 'i': #for smoothing contour plot 1083 1090 choice = ['nearest','bilinear','bicubic','spline16','spline36','hanning', … … 1092 1099 dlg.Destroy() 1093 1100 elif event.key == 't' and not G2frame.Contour: 1094 if G2frame.Legend: 1095 G2frame.Legend = False 1096 else: 1097 G2frame.Legend = True 1101 G2frame.Legend = not G2frame.Legend 1098 1102 PlotISFG(G2frame,newPlot=newPlot,type=type) 1099 1103 … … 2143 2147 def OnKeyPress(event): 2144 2148 if event.key == 's' and sampleParm: 2145 if G2frame.xAxis: 2146 G2frame.xAxis = False 2147 else: 2148 G2frame.xAxis = True 2149 G2frame.xAxis = not G2frame.xAxis 2149 2150 Draw(False) 2150 2151 try: … … 2305 2306 G2frame.StrainKey = event.key 2306 2307 OnStartNewDzero(G2frame) 2307 2308 2308 2309 2309 elif PickName == 'Image Controls': … … 2323 2323 dlg.Destroy() 2324 2324 elif event.key == 'l': 2325 if G2frame.logPlot: 2326 G2frame.logPlot = False 2327 else: 2328 G2frame.logPlot = True 2325 G2frame.logPlot = not G2frame.logPlot 2329 2326 elif event.key in ['x',]: 2330 if Data['invert_x']: 2331 Data['invert_x'] = False 2332 else: 2333 Data['invert_x'] = True 2327 Data['invert_x'] = not Data['invert_x'] 2334 2328 elif event.key in ['y',]: 2335 if Data['invert_y']: 2336 Data['invert_y'] = False 2337 else: 2338 Data['invert_y'] = True 2329 Data['invert_y'] = not Data['invert_y'] 2339 2330 PlotImage(G2frame,newPlot=False) 2340 2331
Note: See TracChangeset
for help on using the changeset viewer.