We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Now I use such constructions for drawing:
bw, = ax.plot(np.linspace(x.min(), x.max(),1000), fit.bw(x=np.linspace(x.min(), x.max(),1000), M = result.best_values['bw_M'], G=result.best_values['bw_G'], amp=result.best_values['bw_amp'] ), 'g--',label=r'Breit-Wigner') bkg, = plt.plot(np.linspace(x.min(), x.max(),1000), fit.polyn(np.linspace(x.min(), x.max(),1000), result.best_values['bckg_c0'], result.best_values['bckg_c1'], result.best_values['bckg_c2'], result.best_values['bckg_c3'], result.best_values['bckg_c4'],0,0,0, result.best_values['bckg_amp']), 'b--', label='Bckgr fit') # plt.plot(bcg_x, bcg_y, 'r+', label='bkg data') result.plot_fit(datafmt='ko',fitfmt='r-',numpoints=100,data_kws={'xerr':0.022}) ax.set_title('') _ = ax.set_ylabel(r'Counts per 20 Mev/$c^2$') _ = ax.set_xlabel(r'M$(\pi^+\pi^-\pi^+\pi^-)$ (GeV/$c^2$)') _ = plt.legend([dat,ft, bw, bkg],['Data','Fit','Breit-Wigner','Bkg'])
Instead of this, I can combine data to DataFrames and use pandas plot for drawing purposes
The text was updated successfully, but these errors were encountered:
E.g. this one
# data part xx = np.linspace(x.min(),x.max(),100) ff = result.eval(x=xx) fbw1 = fit.bw(x=xx, M = result.best_values['bw1_M'],G=result.best_values['bw1_G'], amp=result.best_values['bw1_amp'] ) fbw2 = fit.bw(x=xx, M = result.best_values['bw2_M'],G=result.best_values['bw2_G'], amp=result.best_values['bw2_amp'] ) fbckg = fit.polyn(xx, result.best_values['bckg_c0'], result.best_values['bckg_c1'], result.best_values['bckg_c2'], result.best_values['bckg_c3'], result.best_values['bckg_c4'],0,0,0, result.best_values['bckg_amp']) df=pd.DataFrame([xx,ff,fbw1,fbw2,fbckg]).T df.columns=['x', 'fit', 'bw1','bw2', 'bkgr']
# drawing part fig = plt.figure() ax = fig.add_subplot() dt, = hep.histplot(np.histogram(mass_events(kinematics.GetTracksWithPtCut(four_tracks_zq_after_all_cuts)), bins=b, range=r),ax=ax, yerr=True, xerr=0.022, color='black', histtype="errorbar",label='data') ll = df.plot(x='x', y=['fit', 'bw1','bw2', 'bkgr'],ax=ax, style=['r-', 'g-', 'm-', 'b--'], xlabel=r'M($\pi^+\pi^-\pi^+\pi^-$) (GeV/$c^2$)', ylabel=r'Counts per 45 MeV/$c^2$') _ = ax.legend([dt] + ll.get_children()[4:8], ['Data', 'Fit', 'Breit-Wigner', 'Breit-Wigner', 'Bkgr'])
Sorry, something went wrong.
Stopped on #52, #51, #50,#49,#48, #47
05c34b4
bdrum
No branches or pull requests
Now I use such constructions for drawing:
Instead of this, I can combine data to DataFrames and use pandas plot for drawing purposes
The text was updated successfully, but these errors were encountered: