Changeset 4904 for trunk


Ignore:
Timestamp:
May 17, 2021 8:20:11 PM (4 months ago)
Author:
toby
Message:

for in-refinement plotting, get data limits for plotted histogram; make sure to plot a histogram being fit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r4903 r4904  
    29082908        xye = np.array(ma.getdata(Histograms[plotItem]['Data'])) # strips mask
    29092909        xye0 = Histograms[plotItem]['Data'][0]
     2910        limits = Histograms[plotItem]['Limits']
    29102911#        if Page.plotStyle['qPlot']:
    29112912#            X = 2.*np.pi/G2lat.Pos2dsp(Parms,xye0)
     
    29202921        Ibeg = np.searchsorted(X,limits[1][0])
    29212922        Ifin = np.searchsorted(X,limits[1][1])
     2923        if Ibeg == Ifin: # if no points are within limits bad things happen
     2924            Ibeg,Ifin = 0,None
    29222925        if Page.plotStyle['sqrtPlot']:
    29232926            olderr = np.seterr(invalid='ignore') #get around sqrt(-ve) error
     
    30433046        G2frame.SubBack = False
    30443047        Page.plotStyle['logPlot'] = False
     3048        # is the selected histogram in the refinement? if not pick the 1st to show
     3049        Histograms,Phases = G2frame.GetUsedHistogramsAndPhasesfromTree()
     3050        if plottingItem not in Histograms:
     3051            histoList = [i for i in Histograms.keys() if i.startswith('PWDR ')]
     3052            if len(histoList) != 0:
     3053                plottingItem = histoList[0]
     3054                Id = G2gd.GetGPXtreeItemId(G2frame, G2frame.root, plottingItem)
     3055                G2frame.GPXtree.SelectItem(Id)
     3056                wx.CallAfter(PlotPatterns,G2frame,newPlot,plotType,None,
     3057                     extraKeys,refineMode)
     3058                return
    30453059    #=====================================================================================
    30463060    if not new:
Note: See TracChangeset for help on using the changeset viewer.