Changeset 2209 for trunk/GSASIIplot.py
- Timestamp:
- Apr 12, 2016 3:46:54 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIplot.py
r2208 r2209 2471 2471 '''simple plot of xy data, used for diagnostic purposes 2472 2472 ''' 2473 def OnKeyPress(event): 2474 if event.key == 'u': 2475 if Page.Offset[1] < 100.: 2476 Page.Offset[1] += 1. 2477 elif event.key == 'd': 2478 if Page.Offset[1] > 0.: 2479 Page.Offset[1] -= 1. 2480 elif event.key == 'l': 2481 Page.Offset[0] -= 1. 2482 elif event.key == 'r': 2483 Page.Offset[0] += 1. 2484 elif event.key == 'o': 2485 Page.Offset = [0,0] 2486 else: 2487 # print 'no binding for key',event.key 2488 #GSASIIpath.IPyBreak() 2489 return 2490 wx.CallAfter(PlotXY,G2frame,XY,XY2,labelX,labelY,False,Title,False) 2491 2473 2492 def OnMotion(event): 2474 2493 xpos = event.xdata … … 2495 2514 plotNum = G2frame.G2plotNB.plotList.index(Title) 2496 2515 Page = G2frame.G2plotNB.nb.GetPage(plotNum) 2516 Page.canvas.mpl_connect('key_press_event', OnKeyPress) 2497 2517 Page.canvas.mpl_connect('motion_notify_event', OnMotion) 2518 Page.Offset = [0,0] 2498 2519 2499 Page.Choice = None 2520 if len(XY2) > 1: 2521 Page.Choice = (' key press','l: offset left','r: offset right','d: offset down', 2522 'u: offset up','o: reset offset',) 2523 else: 2524 Page.Choice = None 2500 2525 G2frame.G2plotNB.RaisePageNoRefresh(Page) 2501 2526 G2frame.G2plotNB.status.DestroyChildren() … … 2510 2535 Plot.set_ylabel(r'Y',fontsize=14) 2511 2536 colors=['b','g','r','c','m','k'] 2537 Page.keyPress = OnKeyPress 2538 Xmax = 0. 2539 Ymax = 0. 2512 2540 for ixy,xy in enumerate(XY): 2513 2541 X,Y = XY[ixy] 2542 Xmax = max(Xmax,max(X)) 2543 Ymax = max(Ymax,max(Y)) 2514 2544 if lines: 2515 2545 Plot.plot(X,Y,colors[ixy%6],picker=False) … … 2519 2549 for ixy,xy in enumerate(XY2): 2520 2550 X,Y = XY2[ixy] 2521 Plot.plot(X,Y,colors[ixy%6],picker=False) 2551 dX = Page.Offset[0]*(ixy+1)*Xmax/500. 2552 dY = Page.Offset[1]*(ixy+1)*Ymax/100. 2553 Plot.plot(X+dX,Y+dY,colors[ixy%6],picker=False) 2522 2554 if not newPlot: 2523 2555 Page.toolbar.push_current() … … 6008 6040 if il: 6009 6041 TX += np.array(Trans[laySeq[il-1]][laySeq[il]][1:4]) 6042 # TX[0] %= 1. 6043 # TX[1] %= 1. 6010 6044 XYZ += TX 6011 6045 AtNames += atNames … … 6354 6388 Page.camera['backColor'] = np.array([0,0,0,0]) 6355 6389 Page.canvas.SetCurrent() 6356 Draw('main')6390 wx.CallAfter(Draw,'main')
Note: See TracChangeset
for help on using the changeset viewer.