Changeset 2209 for trunk/GSASIIplot.py


Ignore:
Timestamp:
Apr 12, 2016 3:46:54 PM (7 years ago)
Author:
vondreele
Message:

Add symmetry (inversion thru ccenter!) to transition probability matrix
Add u,d,l,r shifts of multi XY2 patterns in PlotXY

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r2208 r2209  
    24712471    '''simple plot of xy data, used for diagnostic purposes
    24722472    '''
     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
    24732492    def OnMotion(event):
    24742493        xpos = event.xdata
     
    24952514        plotNum = G2frame.G2plotNB.plotList.index(Title)
    24962515        Page = G2frame.G2plotNB.nb.GetPage(plotNum)
     2516        Page.canvas.mpl_connect('key_press_event', OnKeyPress)
    24972517        Page.canvas.mpl_connect('motion_notify_event', OnMotion)
     2518        Page.Offset = [0,0]
    24982519   
    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
    25002525    G2frame.G2plotNB.RaisePageNoRefresh(Page)
    25012526    G2frame.G2plotNB.status.DestroyChildren()
     
    25102535        Plot.set_ylabel(r'Y',fontsize=14)
    25112536    colors=['b','g','r','c','m','k']
     2537    Page.keyPress = OnKeyPress
     2538    Xmax = 0.
     2539    Ymax = 0.   
    25122540    for ixy,xy in enumerate(XY):
    25132541        X,Y = XY[ixy]
     2542        Xmax = max(Xmax,max(X))
     2543        Ymax = max(Ymax,max(Y))
    25142544        if lines:
    25152545            Plot.plot(X,Y,colors[ixy%6],picker=False)
     
    25192549        for ixy,xy in enumerate(XY2):
    25202550            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)
    25222554    if not newPlot:
    25232555        Page.toolbar.push_current()
     
    60086040            if il:
    60096041                TX += np.array(Trans[laySeq[il-1]][laySeq[il]][1:4])
     6042#                TX[0] %= 1.
     6043#                TX[1] %= 1.
    60106044                XYZ += TX
    60116045            AtNames += atNames
     
    63546388    Page.camera['backColor'] = np.array([0,0,0,0])
    63556389    Page.canvas.SetCurrent()
    6356     Draw('main')
     6390    wx.CallAfter(Draw,'main')
Note: See TracChangeset for help on using the changeset viewer.