From 3ad6abfb9510f3d7207ad260488f07026cec56e9 Mon Sep 17 00:00:00 2001 From: Garrett Granroth Date: Thu, 14 Apr 2022 18:33:41 -0400 Subject: [PATCH] Update dynrange.py Change plotDynRangeOfSlice to have labels on the x and y axis and updated to ax. interface rather than plt. interface for matplotlib --- workflow/singlextal/dynrange.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/workflow/singlextal/dynrange.py b/workflow/singlextal/dynrange.py index 1bfc1a4..5487605 100644 --- a/workflow/singlextal/dynrange.py +++ b/workflow/singlextal/dynrange.py @@ -12,14 +12,18 @@ def plotDynRangeOfSlice( scattering_angle_constraints, Erange=None): from matplotlib import pyplot as plt + f,ax = plt.subplots() for psi, xs, Es in iterPointsInSlice( sample, psi_angles, Ei, hkl0, hkl_dir, xaxis, scattering_angle_constraints, Erange=Erange): - plt.plot(xs, Es, label=str(psi)) + ax.plot(xs, Es, label=str(psi)) continue - # plt.legend() + ax.set_ylabel("Energy (meV))") + ax.set_xlabel("{},{}".format(hkl0,hkl_dir)) + # ax.legend() + f.show() return