Skip to content
Snippets Groups Projects
Commit 93aaf2db authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

simplify example PolarizedSpinAsymmetry

parent c886222b
No related branches found
No related tags found
No related merge requests found
......@@ -112,35 +112,6 @@ def qr(result):
####################################################################
def plot(qs, rs, exps, labels, filename):
"""
Plot the simulated result together with the experimental data
"""
fig = plt.figure()
ax = fig.add_subplot(111)
for q, r, exp, l in zip(qs, rs, exps, labels):
ax.errorbar(exp[0],
exp[1],
xerr=exp[3],
yerr=exp[2],
fmt='.',
markersize=0.75,
linewidth=0.5)
ax.plot(q, r, label=l)
ax.set_yscale('log')
plt.legend()
plt.xlabel("Q [nm${}^{-1}$]")
plt.ylabel("R")
plt.tight_layout()
plt.savefig(filename)
def plotSpinAsymmetry(data_pp, data_mm, q, r_pp, r_mm, filename):
"""
Plot the simulated spin asymmetry as well its
......@@ -232,8 +203,32 @@ if __name__ == '__main__':
data_pp = filterData(expdata_pp, qmin, qmax)
data_mm = filterData(expdata_mm, qmin, qmax)
plot([q_pp, q_mm], [r_pp, r_mm], [data_pp, data_mm], ["$++$", "$--$"],
"MAFO_Saturated.pdf")
fig = plt.figure()
ax = fig.add_subplot(111)
def plot_data(exp):
ax.errorbar(exp[0],
exp[1],
xerr=exp[3],
yerr=exp[2],
fmt='.',
markersize=0.75,
linewidth=0.5)
plot_data(data_pp)
plot_data(data_mm)
ax.plot(q_pp, r_pp, label="$++$")
ax.plot(q_mm, r_mm, label="$--$")
ax.set_yscale('log')
plt.legend()
plt.xlabel("Q [nm${}^{-1}$]")
plt.ylabel("R")
plt.tight_layout()
# plt.savefig("MAFO_Saturated.pdf")
plotSpinAsymmetry(data_pp, data_mm, qzs, r_pp, r_mm,
"MAFO_Saturated_spin_asymmetry.pdf")
......
......@@ -112,35 +112,6 @@ def qr(result):
####################################################################
def plot(qs, rs, exps, labels, filename):
"""
Plot the simulated result together with the experimental data
"""
fig = plt.figure()
ax = fig.add_subplot(111)
for q, r, exp, l in zip(qs, rs, exps, labels):
ax.errorbar(exp[0],
exp[1],
xerr=exp[3],
yerr=exp[2],
fmt='.',
markersize=0.75,
linewidth=0.5)
ax.plot(q, r, label=l)
ax.set_yscale('log')
plt.legend()
plt.xlabel("Q [nm${}^{-1}$]")
plt.ylabel("R")
plt.tight_layout()
plt.savefig(filename)
def plotSpinAsymmetry(data_pp, data_mm, q, r_pp, r_mm, filename):
"""
Plot the simulated spin asymmetry as well its
......@@ -232,8 +203,32 @@ if __name__ == '__main__':
data_pp = filterData(expdata_pp, qmin, qmax)
data_mm = filterData(expdata_mm, qmin, qmax)
plot([q_pp, q_mm], [r_pp, r_mm], [data_pp, data_mm], ["$++$", "$--$"],
"MAFO_Saturated.pdf")
fig = plt.figure()
ax = fig.add_subplot(111)
def plot_data(exp):
ax.errorbar(exp[0],
exp[1],
xerr=exp[3],
yerr=exp[2],
fmt='.',
markersize=0.75,
linewidth=0.5)
plot_data(data_pp)
plot_data(data_mm)
ax.plot(q_pp, r_pp, label="$++$")
ax.plot(q_mm, r_mm, label="$--$")
ax.set_yscale('log')
plt.legend()
plt.xlabel("Q [nm${}^{-1}$]")
plt.ylabel("R")
plt.tight_layout()
# plt.savefig("MAFO_Saturated.pdf")
plotSpinAsymmetry(data_pp, data_mm, qzs, r_pp, r_mm,
"MAFO_Saturated_spin_asymmetry.pdf")
......
......@@ -112,35 +112,6 @@ def qr(result):
####################################################################
def plot(qs, rs, exps, labels, filename):
"""
Plot the simulated result together with the experimental data
"""
fig = plt.figure()
ax = fig.add_subplot(111)
for q, r, exp, l in zip(qs, rs, exps, labels):
ax.errorbar(exp[0],
exp[1],
xerr=exp[3],
yerr=exp[2],
fmt='.',
markersize=0.75,
linewidth=0.5)
ax.plot(q, r, label=l)
ax.set_yscale('log')
plt.legend()
plt.xlabel("Q [nm${}^{-1}$]")
plt.ylabel("R")
plt.tight_layout()
plt.savefig(filename)
def plotSpinAsymmetry(data_pp, data_mm, q, r_pp, r_mm, filename):
"""
Plot the simulated spin asymmetry as well its
......@@ -232,8 +203,32 @@ if __name__ == '__main__':
data_pp = filterData(expdata_pp, qmin, qmax)
data_mm = filterData(expdata_mm, qmin, qmax)
plot([q_pp, q_mm], [r_pp, r_mm], [data_pp, data_mm], ["$++$", "$--$"],
"MAFO_Saturated.pdf")
fig = plt.figure()
ax = fig.add_subplot(111)
def plot_data(exp):
ax.errorbar(exp[0],
exp[1],
xerr=exp[3],
yerr=exp[2],
fmt='.',
markersize=0.75,
linewidth=0.5)
plot_data(data_pp)
plot_data(data_mm)
ax.plot(q_pp, r_pp, label="$++$")
ax.plot(q_mm, r_mm, label="$--$")
ax.set_yscale('log')
plt.legend()
plt.xlabel("Q [nm${}^{-1}$]")
plt.ylabel("R")
plt.tight_layout()
# plt.savefig("MAFO_Saturated.pdf")
plotSpinAsymmetry(data_pp, data_mm, qzs, r_pp, r_mm,
"MAFO_Saturated_spin_asymmetry.pdf")
......
......@@ -112,35 +112,6 @@ def qr(result):
####################################################################
def plot(qs, rs, exps, labels, filename):
"""
Plot the simulated result together with the experimental data
"""
fig = plt.figure()
ax = fig.add_subplot(111)
for q, r, exp, l in zip(qs, rs, exps, labels):
ax.errorbar(exp[0],
exp[1],
xerr=exp[3],
yerr=exp[2],
fmt='.',
markersize=0.75,
linewidth=0.5)
ax.plot(q, r, label=l)
ax.set_yscale('log')
plt.legend()
plt.xlabel("Q [nm${}^{-1}$]")
plt.ylabel("R")
plt.tight_layout()
plt.savefig(filename)
def plotSpinAsymmetry(data_pp, data_mm, q, r_pp, r_mm, filename):
"""
Plot the simulated spin asymmetry as well its
......@@ -232,8 +203,32 @@ if __name__ == '__main__':
data_pp = filterData(expdata_pp, qmin, qmax)
data_mm = filterData(expdata_mm, qmin, qmax)
plot([q_pp, q_mm], [r_pp, r_mm], [data_pp, data_mm], ["$++$", "$--$"],
"MAFO_Saturated.pdf")
fig = plt.figure()
ax = fig.add_subplot(111)
def plot_data(exp):
ax.errorbar(exp[0],
exp[1],
xerr=exp[3],
yerr=exp[2],
fmt='.',
markersize=0.75,
linewidth=0.5)
plot_data(data_pp)
plot_data(data_mm)
ax.plot(q_pp, r_pp, label="$++$")
ax.plot(q_mm, r_mm, label="$--$")
ax.set_yscale('log')
plt.legend()
plt.xlabel("Q [nm${}^{-1}$]")
plt.ylabel("R")
plt.tight_layout()
# plt.savefig("MAFO_Saturated.pdf")
plotSpinAsymmetry(data_pp, data_mm, qzs, r_pp, r_mm,
"MAFO_Saturated_spin_asymmetry.pdf")
......
......@@ -112,35 +112,6 @@ def qr(result):
####################################################################
def plot(qs, rs, exps, labels, filename):
"""
Plot the simulated result together with the experimental data
"""
fig = plt.figure()
ax = fig.add_subplot(111)
for q, r, exp, l in zip(qs, rs, exps, labels):
ax.errorbar(exp[0],
exp[1],
xerr=exp[3],
yerr=exp[2],
fmt='.',
markersize=0.75,
linewidth=0.5)
ax.plot(q, r, label=l)
ax.set_yscale('log')
plt.legend()
plt.xlabel("Q [nm${}^{-1}$]")
plt.ylabel("R")
plt.tight_layout()
plt.savefig(filename)
def plotSpinAsymmetry(data_pp, data_mm, q, r_pp, r_mm, filename):
"""
Plot the simulated spin asymmetry as well its
......@@ -232,8 +203,32 @@ if __name__ == '__main__':
data_pp = filterData(expdata_pp, qmin, qmax)
data_mm = filterData(expdata_mm, qmin, qmax)
plot([q_pp, q_mm], [r_pp, r_mm], [data_pp, data_mm], ["$++$", "$--$"],
"MAFO_Saturated.pdf")
fig = plt.figure()
ax = fig.add_subplot(111)
def plot_data(exp):
ax.errorbar(exp[0],
exp[1],
xerr=exp[3],
yerr=exp[2],
fmt='.',
markersize=0.75,
linewidth=0.5)
plot_data(data_pp)
plot_data(data_mm)
ax.plot(q_pp, r_pp, label="$++$")
ax.plot(q_mm, r_mm, label="$--$")
ax.set_yscale('log')
plt.legend()
plt.xlabel("Q [nm${}^{-1}$]")
plt.ylabel("R")
plt.tight_layout()
# plt.savefig("MAFO_Saturated.pdf")
plotSpinAsymmetry(data_pp, data_mm, qzs, r_pp, r_mm,
"MAFO_Saturated_spin_asymmetry.pdf")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment