parameters: (filenameFormat, r, tofWS, fICC, runNumber, peakNumber, energy, chiSq, bgFinal, xStart, xStop, bgx0=None)
docstring: Function to make and save plots of the fits. bgx0=polynomial coefficients (polyfit order)
      for the initial guess
docstring_summary: Function to make and save plots of the fits. bgx0=polynomial coefficients (polyfit order)
      for the initial guess
docstring_tokens: Function to make and save plots of the fits . bgx0 = polynomial coefficients ( polyfit order ) for the initial guess
function: def plotFit(filenameFormat, r, tofWS, fICC, runNumber, peakNumber, energy, chiSq, bgFinal, xStart, xStop, bgx0=None):
      """
      Function to make and save plots of the fits. bgx0=polynomial coefficients (polyfit order)
      for the initial guess
      """
      plt.figure(1)
      plt.clf()
      plt.plot(r.readX(0), r.readY(0), 'o', label='Data')
      if bgx0 is not None:
          plt.plot(tofWS.readX(0), fICC.function1D(tofWS.readX(0))
                   + np.polyval(bgx0, tofWS.readX(0)), 'b', label='Initial Guess')
      else:
          plt.plot(tofWS.readX(0), fICC.function1D(
              tofWS.readX(0)), 'b', label='Initial Guess')
  
      plt.plot(r.readX(1), r.readY(1), '.-', label='Fit')
      plt.plot(r.readX(1), np.polyval(
          bgFinal, r.readX(1)), 'r', label='Background')
      yLims = plt.ylim()
      plt.plot([xStart, xStart], yLims, 'k')
      plt.plot([xStop, xStop], yLims, 'k')
      plt.title('E0=%4.4f meV, redChiSq=%4.4e' % (energy*1000, chiSq))
      plt.legend(loc='best')
      plt.savefig(filenameFormat % (runNumber, peakNumber))
function_tokens: def plotFit ( filenameFormat , r , tofWS , fICC , runNumber , peakNumber , energy , chiSq , bgFinal , xStart , xStop , bgx0 = None ) : plt . figure ( 1 ) plt . clf ( ) plt . plot ( r . readX ( 0 ) , r . readY ( 0 ) , 'o' , label = 'Data' ) if bgx0 is not None : plt . plot ( tofWS . readX ( 0 ) , fICC . function1D ( tofWS . readX ( 0 ) ) + np . polyval ( bgx0 , tofWS . readX ( 0 ) ) , 'b' , label = 'Initial Guess' ) else : plt . plot ( tofWS . readX ( 0 ) , fICC . function1D ( tofWS . readX ( 0 ) ) , 'b' , label = 'Initial Guess' ) plt . plot ( r . readX ( 1 ) , r . readY ( 1 ) , '.-' , label = 'Fit' ) plt . plot ( r . readX ( 1 ) , np . polyval ( bgFinal , r . readX ( 1 ) ) , 'r' , label = 'Background' ) yLims = plt . ylim ( ) plt . plot ( [ xStart , xStart ] , yLims , 'k' ) plt . plot ( [ xStop , xStop ] , yLims , 'k' ) plt . title ( 'E0=%4.4f meV, redChiSq=%4.4e' % ( energy * 1000 , chiSq ) ) plt . legend ( loc = 'best' ) plt . savefig ( filenameFormat % ( runNumber , peakNumber ) )