Changeset 4084


Ignore:
Timestamp:
Aug 9, 2019 9:34:13 AM (4 years ago)
Author:
vondreele
Message:

fixes to SHAPES results table
fix remaining plot amnesia problems

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/G2shapes.py

    r4079 r4084  
    2121# this version modified by R B. Von Dreele for inclusion in GSAS-II
    2222
     23from __future__ import division, print_function
    2324import math
    2425import sys
  • trunk/GSASIIplot.py

    r4079 r4084  
    10261026    if not new:
    10271027        if not newPlot:
    1028             xylim = lim
     1028            xylim = copy.copy(lim)
    10291029    else:
    10301030        Page.canvas.mpl_connect('button_press_event', OnSCPress)
     
    12721272    if not new:
    12731273        if not newPlot:
    1274             xylim = lim
     1274            xylim = copy.copy(lim)
    12751275    else:
    12761276        newPlot = True
     
    48024802    if not new:
    48034803        if not newPlot:
    4804             xylim = lim
     4804            xylim = copy.copy(lim)
    48054805    else:
    48064806        newPlot = True
     
    49634963    if not new:
    49644964        if not newPlot:
    4965             xylim = lim
     4965            xylim = copy.copy(lim)
    49664966    else:
    49674967        newPlot = True
     
    50585058    if not new:
    50595059        if not newPlot:
    5060             xylim = lim
     5060            xylim = copy.copy(lim)
    50615061    else:
    50625062        newPlot = True
     
    51865186    if not new:
    51875187        if not newPlot:
    5188             xylim = lim
     5188            xylim = copy.copy(lim)
    51895189    else:
    51905190        newPlot = True
     
    52285228        elif 'Pair' in PlotText:
    52295229            PlotSASDPairDist(G2frame)
    5230            
    52315230   
    52325231    def OnMotion(event):
     
    53015300    Plot.set_ylabel(r'$Pair\ distribution,\ P(R)$',fontsize=14)
    53025301    Plot.bar(Bins-Dbins,BinMag,Dbins,facecolor='white',edgecolor='green')       #plot diameters
    5303     colors=['b','r','c','m','k']
     5302    if 'Pair Calc' in data['Pair']:
     5303        [Rbins,Dist] = data['Pair']['Pair Calc'].T
     5304        Plot.plot(Rbins,Dist,color='r')       #plot radii
    53045305    Page.canvas.draw()
    53055306
     
    54335434    if not new:
    54345435        if not G2frame.G2plotNB.allowZoomReset: # save previous limits
    5435             xylim = lim
     5436            xylim = copy.copy(lim)
    54365437    else:
    54375438        Page.canvas.mpl_connect('motion_notify_event', OnMotion)
     
    76867687    if not new:
    76877688        if not newPlot:
    7688             xylim = lim
     7689            xylim = copy.copy(lim)
    76897690    else:
    76907691        Page.canvas.mpl_connect('motion_notify_event', OnMotion)
     
    77417742    if not new:
    77427743        if not newPlot:
    7743             xylim = lim
     7744            xylim = copy.copy(lim)
    77447745    else:
    77457746        Page.canvas.mpl_connect('motion_notify_event', OnMotion)
     
    92679268        GL.glTranslate(x,y,z)
    92689269        q = GLU.gluNewQuadric()
    9269         GLU.gluSphere(q,radius,20,10)
     9270        GLU.gluSphere(q,radius,40,20)
    92709271        GL.glPopMatrix()
    92719272       
     
    92999300        for iat,atom in enumerate(XYZ):
    93009301            x,y,z = atom
    9301             color = (144,144,144)
     9302            color = np.array([144,144,144])/255.
    93029303            RenderSphere(x,y,z,radius,color)
    93039304        try:
  • trunk/GSASIIpwdGUI.py

    r4081 r4084  
    56585658        def OnShapeSelect(event):
    56595659            r,c =  event.GetRow(),event.GetCol()
    5660             shapeTable.SetValue(r,c,False)
     5660            for i in [1,2]:
     5661                for j in range(len(Patterns)):
     5662                    shapeTable.SetValue(j,i,False)
     5663            shapeTable.SetValue(r,c,True)
     5664            ShapesResult.ForceRefresh()
    56615665            selAtoms = Atoms[2*r+(c-1)]
    56625666            pattern = Patterns[r]
    5663             PRvals = PRcalc[r]
     5667            data['Pair']['Pair Calc'] = np.array([PRcalc[r][0],PRcalc[r][2]]).T
    56645668            print('%s %d'%('num. beads',len(selAtoms[1])))
    56655669            print('%s %.3f'%('selected r value',pattern[-1]))
    5666             print('%s %.3f'%('selected Delta P(r)',PRvals[-1]))
     5670            print('%s %.3f'%('selected Delta P(r)',PRcalc[r][-1]))
    56675671            G2plt.PlotSASDPairDist(G2frame)
    56685672            RefreshPlots(True)
     
    57195723            tableVals = []
    57205724            for i in range(len(Patterns)):
    5721                 tableVals.append([Atoms[2*i][0],False,False,Patterns[i][-1],PRcalc[i][-1],len(Atoms[2*1][1]),len(Atoms[2*i+1][1])])
     5725                tableVals.append([Atoms[2*i][0],False,False,Patterns[i][-1],PRcalc[i][-1],len(Atoms[2*i][1]),len(Atoms[2*i+1][1])])
    57225726            shapeTable = G2G.Table(tableVals,rowLabels=rowLabels,colLabels=colLabels,types=Types)
    57235727            ShapesResult = G2G.GSGrid(G2frame.dataWindow)
    57245728            ShapesResult.SetTable(shapeTable,True)
    57255729            ShapesResult.AutoSizeColumns(False)
    5726             ShapesResult.Bind(wg.EVT_GRID_CELL_CHANGED, OnShapeSelect)
     5730            ShapesResult.Bind(wg.EVT_GRID_CELL_LEFT_CLICK, OnShapeSelect)
    57275731            for r in range(len(Patterns)):
    57285732                for c in range(7):
Note: See TracChangeset for help on using the changeset viewer.