Changeset 3868


Ignore:
Timestamp:
Apr 2, 2019 5:49:55 PM (3 years ago)
Author:
toby
Message:

Fix possible overwrite of PWDR children

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r3854 r3868  
    18081808            PublishRietveldPlot(G2frame,Pattern,Plot,Page)
    18091809
    1810     global exclLines,Page
    1811     global DifLine # BHT: probably does not need to be global
    1812     global Ymax
    1813     global Pattern,mcolors,Plot,Page,imgAx,Temps
    1814     plottype = plotType
    1815    
    1816     if not G2frame.PatternId:
    1817         return
    1818     if 'PKS' in plottype:
    1819         PlotPowderLines(G2frame)
    1820         return
    1821 #patch
    1822     if data is None:
    1823         data = G2frame.GPXtree.GetItemPyData(G2frame.PatternId)
    1824     if plottype not in ['SASD','REFD'] and 'PWDR' in G2frame.GPXtree.GetItemText(G2frame.PickId):
    1825         publish = PublishPlot
    1826     else:
    1827         publish = None
    1828     new,plotNum,Page,Plot,limits = G2frame.G2plotNB.FindPlotTab('Powder Patterns','mpl',publish=publish)
    1829     if 'Offset' not in Page.plotStyle and plotType in ['PWDR','SASD','REFD']:     #plot offset data
    1830         Ymax = max(data[1][1])
    1831         Page.plotStyle.update({'Offset':[0.0,0.0],'delOffset':0.02*Ymax,'refOffset':-0.1*Ymax,
    1832             'refDelt':0.1*Ymax,})
    1833         G2frame.GPXtree.SetItemPyData(G2frame.PickId,data)
    1834 #end patch
    18351810    def OnPlotKeyPress(event):
    18361811        try:        #one way to check if key stroke will work on plot
     
    25372512    #=====================================================================================
    25382513    # beginning PlotPatterns execution
     2514    global exclLines,Page
     2515    global DifLine # BHT: probably does not need to be global
     2516    global Ymax
     2517    global Pattern,mcolors,Plot,Page,imgAx,Temps
     2518    plottype = plotType
     2519   
     2520    if not G2frame.PatternId:
     2521        return
     2522    if 'PKS' in plottype:
     2523        PlotPowderLines(G2frame)
     2524        return
     2525    if data is None:
     2526        data = G2frame.GPXtree.GetItemPyData(G2frame.PatternId)
     2527    if plottype not in ['SASD','REFD'] and 'PWDR' in G2frame.GPXtree.GetItemText(G2frame.PickId):
     2528        publish = PublishPlot
     2529    else:
     2530        publish = None
     2531    new,plotNum,Page,Plot,limits = G2frame.G2plotNB.FindPlotTab('Powder Patterns','mpl',publish=publish)
     2532#patch
     2533    if 'Offset' not in Page.plotStyle and plotType in ['PWDR','SASD','REFD']:     #plot offset data
     2534        Ymax = max(data[1][1])
     2535        Page.plotStyle.update({'Offset':[0.0,0.0],'delOffset':0.02*Ymax,'refOffset':-0.1*Ymax,
     2536            'refDelt':0.1*Ymax,})
     2537#end patch
    25392538    if not new:
    25402539        G2frame.xylim = limits
Note: See TracChangeset for help on using the changeset viewer.