Changeset 4006 for trunk/GSASIIplot.py


Ignore:
Timestamp:
May 30, 2019 8:20:35 PM (4 years ago)
Author:
toby
Message:

fix seq. plot where esd is None

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r4005 r4006  
    277277                 squeeze=True, subplot_kw=None, gridspec_kw=None):
    278278        """
    279         Copy of Figure.figure.subplots from matplotlib.figure.py
     279        Add a set of subplots to this figure.
     280       
     281        This is a copy of Figure.figure.subplots from matplotlib.figure.py.
    280282        Included here because this appears only in later versions of
    281         matplotlib. When v2.2 is standard, this can be removed from GSAS-II
    282        
    283         Add a set of subplots to this figure.
    284        
    285         :param nrows, ncols : int, default: 1
     283        matplotlib. When v2.2 is standard, this should be removed from GSAS-II.
     284       
     285        :param int nrows, ncols: default: 1
    286286            Number of rows/cols of the subplot grid.
    287         :param sharex, sharey : bool or {'none', 'all', 'row', 'col'}, default: False
     287        :param bool/str sharex, sharey: True/False or {'none', 'all', 'row', 'col'}, default: False
     288
    288289            Controls sharing of properties among x (`sharex`) or y (`sharey`)
    289290            axes:
     
    300301            subplots have a shared y-axis along a row, only the y tick labels
    301302            of the first column subplot are visible.
    302         :param squeeze : bool, default: True
     303        :param bool squeeze: default: True
     304
    303305            - If True, extra dimensions are squeezed out from the returned
    304306              axis object:
     
    316318              up being 1x1.
    317319             
    318         :param subplot_kw : dict, default: {}
     320        :param dict subplot_kw: default: {}
    319321            Dict with keywords passed to the
    320             :meth:`~matplotlib.figure.Figure.add_subplot` call used to create
     322            :meth:`matplotlib.figure.Figure.add_subplot` call used to create
    321323            each subplots.
    322         :param gridspec_kw : dict, default: {}
     324        :param dict gridspec_kw: default: {}
    323325            Dict with keywords passed to the
    324             :class:`~matplotlib.gridspec.GridSpec` constructor used to create
     326            :class:`matplotlib.gridspec.GridSpec` constructor used to create
    325327            the grid the subplots are placed on.
    326328           
    327         :return: ax : single Axes object or array of Axes objects
    328             The added axes.  The dimensions of the resulting array can be
     329        :returns: A single Axes object or array of Axes objects with
     330            the added axes.  The dimensions of the resulting array can be
    329331            controlled with the squeeze keyword, see above.
    330332           
    331         See Also pyplot.subplots : pyplot API; docstring includes examples.
     333        See also: pyplot.subplots: pyplot API; docstring includes examples.
    332334       
    333335        """
     
    63846386    def Draw():
    63856387        global Title,xLabel,yLabel
    6386         G2frame.G2plotNB.status.SetStatusText(  \
     6388        G2frame.G2plotNB.status.SetStatusText(
    63876389            'press L to toggle lines, S to select X axis, T to change titles (reselect column to show?)',1)
    63886390        Plot.clear()
     
    63916393        if G2frame.seqXaxis is not None:   
    63926394            xName,X,Xsig = Page.seqTableGet(G2frame.seqXaxis)
     6395            if G2frame.seqReverse and not G2frame.seqXaxis:
     6396                X = X[::-1]
    63936397        else:
    63946398            X = np.arange(0,G2frame.SeqTable.GetNumberRows(),1)
     
    63976401            Ncol = colors[ic%6]
    63986402            name,Y,sig = Page.seqTableGet(col)
    6399             # deal with missing (None) values
     6403            if G2frame.seqReverse and not G2frame.seqXaxis:
     6404                Y = Y[::-1]
     6405                sig = sig[::-1]
     6406            # deal with missing (None) values in arrays
    64006407            Xnew = []
    64016408            Ynew = []
    64026409            Ysnew = []
     6410            gotsig = False
    64036411            for i in range(len(X)):
    64046412                if not uselist[i]:
    64056413                    continue
    64066414                if X[i] is None or Y[i] is None:
    6407                     if Ysnew:
    6408                         if G2frame.seqReverse and not G2frame.seqXaxis:
    6409                             Ynew = Ynew[::-1]
    6410                             Ysnew = Ysnew[::-1]
    6411                         if G2frame.seqLines:
    6412                             Plot.errorbar(Xnew,Ynew,yerr=Ysnew,color=Ncol)
    6413                         else:
    6414                             Plot.errorbar(Xnew,Ynew,yerr=Ysnew,linestyle='None',color=Ncol,marker='x')
    6415                     else:
    6416                         if G2frame.seqReverse and not G2frame.seqXaxis:
    6417                             Ynew = Ynew[::-1]
    6418                         Plot.plot(Xnew,Ynew,color=Ncol)
    6419                         Plot.plot(Xnew,Ynew,'o',color=Ncol)
    6420                     Xnew = []
    6421                     Ynew = []
    6422                     Ysnew = []
    64236415                    continue
    64246416                Xnew.append(X[i])
    64256417                Ynew.append(Y[i])
    6426                 if sig: Ysnew.append(sig[i])
    6427             if Ysnew:
    6428                 if G2frame.seqReverse and not G2frame.seqXaxis:
    6429                     Ynew = Ynew[::-1]
    6430                     Ysnew = Ysnew[::-1]
     6418                if sig[i]:
     6419                    gotsig = True
     6420                    Ysnew.append(sig[i])
     6421                else:
     6422                    Ysnew.append(0.0)
     6423            if gotsig:
    64316424                if G2frame.seqLines:
    64326425                    Plot.errorbar(Xnew,Ynew,yerr=Ysnew,color=Ncol,label=name)
     
    64346427                    Plot.errorbar(Xnew,Ynew,yerr=Ysnew,label=name,linestyle='None',color=Ncol,marker='x')
    64356428            else:
    6436                 if G2frame.seqReverse and not G2frame.seqXaxis:
    6437                     Ynew = Ynew[::-1]
    64386429                Plot.plot(Xnew,Ynew,color=Ncol)
    64396430                Plot.plot(Xnew,Ynew,'o',color=Ncol,label=name)
Note: See TracChangeset for help on using the changeset viewer.