Changeset 4637


Ignore:
Timestamp:
Nov 2, 2020 12:34:56 PM (12 months ago)
Author:
toby
Message:

reset plot when changing between data types

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIdataGUI.py

    r4635 r4637  
    40924092                    else:
    40934093                        self.G2plotNB.Delete('Powder Patterns')
     4094                        self.lastPlotType = None
    40944095                    if not nItems['IMG']:
    40954096                        self.G2plotNB.Delete('2D Powder Image')
     
    51455146                if GSASIIpath.GetConfigValue('debug'):
    51465147                    print('Closing out-of-date plot',lbl)
     5148                if lbl == 'Powder Patterns':
     5149                    self.lastPlotType = None
    51475150                self.G2plotNB.Delete(lbl)
    51485151        # put the previously last-raised plot tab on top, if present.
  • trunk/GSASIIplot.py

    r4634 r4637  
    26752675            'refDelt':0.1*Ymax,})
    26762676#end patch
     2677    # reset plot when changing between different data types
     2678    try:
     2679        G2frame.lastPlotType
     2680    except:
     2681        G2frame.lastPlotType = None
     2682    if plotType == 'PWDR':
     2683        Parms,Parms2 = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,
     2684            G2frame.PatternId, 'Instrument Parameters'))
     2685        if G2frame.lastPlotType != Parms['Type'][1]:
     2686            print('triggering newplot from G2frame.lastPlotType')
     2687            Ymax = max(data[1][1])
     2688            if Page.plotStyle['sqrtPlot']:
     2689                Page.plotStyle['delOffset'] = .02*np.sqrt(Ymax)
     2690                Page.plotStyle['refOffset'] = -0.1*np.sqrt(Ymax)
     2691                Page.plotStyle['refDelt'] = .1*np.sqrt(Ymax)
     2692            else:
     2693                Page.plotStyle['delOffset'] = .02*Ymax
     2694                Page.plotStyle['refOffset'] = -0.1*Ymax
     2695                Page.plotStyle['refDelt'] = .1*Ymax
     2696            newPlot = True
     2697        G2frame.lastPlotType = Parms['Type'][1]
     2698       
    26772699    try:
    26782700        G2frame.FixedLimits
Note: See TracChangeset for help on using the changeset viewer.