Hello,
when running the attached two script one after the other to plot 2D and 1D plot, the 1D plot is corrupted. This does not happen if they are run separately.
Tatiana
2D plot script
Python Script Generated by Mslice on 2019-04-02 11:00:21
import mslice.cli as mc
import mslice.plotting.pyplot as plt
DytBuOCl_Ei90_00meV_5K = mc.Load(Filename=’/home/ecz46986/RB1910185/SPE/Dy(tBuO)Cl_Ei90.00meV_5K.nxspe’, OutputWorkspace=‘Dy(tBuO)Cl_Ei90.00meV_5K’)
YtBuOCl_Ei90_00meV_5K = mc.Load(Filename=’/home/ecz46986/RB1910185/SPE/Y(tBuO)Cl_Ei90.00meV_5K.nxspe’, OutputWorkspace=‘Y(tBuO)Cl_Ei90.00meV_5K’)
scaled_bg_ws = mc.Scale(InputWorkspace=YtBuOCl_Ei90_00meV_5K, OutputWorkspace=‘scaled_bg_ws’, Factor=‘1.1’)
ws_DytBuOCl_Ei90_00meV_5K_subtracted = mc.Minus(LHSWorkspace=DytBuOCl_Ei90_00meV_5K, RHSWorkspace=scaled_bg_ws, OutputWorkspace=‘Dy(tBuO)Cl_Ei90.00meV_5K_subtracted’)
fig = plt.gcf()
ax = fig.add_subplot(111, projection=“mslice”)
slice_ws = mc.Slice(ws_DytBuOCl_Ei90_00meV_5K_subtracted, Axis1="|Q|,0.28338,13.67972,0.1", Axis2=“DeltaE,-45.0,81.0,0.45”, NormToOne=False)
mesh = ax.pcolormesh(slice_ws, cmap=“jet”)
mesh.set_clim(0,100)
cb = plt.colorbar(mesh, ax=ax)
cb.set_label(‘Intensity (arb. units)’, labelpad=20, rotation=270, picker=5)
ax.set_title(‘Dy(tBuO)Cl_Ei90.00meV_5K_subtracted’)
mc.Show()
#1D plot
import mslice.cli as mc
import mslice.plotting.pyplot as plt
DytBuOCl_Ei90_00meV_5K = mc.Load(Filename=’/home/ecz46986/RB1910185/SPE/Dy(tBuO)Cl_Ei90.00meV_5K.nxspe’, OutputWorkspace=‘Dy(tBuO)Cl_Ei90.00meV_5K’)
YtBuOCl_Ei90_00meV_5K = mc.Load(Filename=’/home/ecz46986/RB1910185/SPE/Y(tBuO)Cl_Ei90.00meV_5K.nxspe’, OutputWorkspace=‘Y(tBuO)Cl_Ei90.00meV_5K’)
scaled_bg_ws = mc.Scale(InputWorkspace=YtBuOCl_Ei90_00meV_5K, OutputWorkspace=‘scaled_bg_ws’, Factor=‘1.1’)
ws_DytBuOCl_Ei90_00meV_5K_subtracted = mc.Minus(LHSWorkspace=DytBuOCl_Ei90_00meV_5K, RHSWorkspace=scaled_bg_ws, OutputWorkspace=‘Dy(tBuO)Cl_Ei90.00meV_5K_subtracted’)
cut_ws_0 = mc.Cut(ws_DytBuOCl_Ei90_00meV_5K_subtracted,CutAxis=“DeltaE,-10.0,90.0,0.2”, IntegrationAxis="|Q|,0.0,4.0,0.0", NormToOne=False)
fig = plt.gcf()
ax = fig.add_subplot(111, projection=“mslice”)
ax.errorbar(cut_ws_0, label=“Dy-cene_Ei9.00meV_130_5K 0.00<|Q|<4.00”, color=“b”, marker=“o”, ls="-", lw=1.0, intensity_range=(0.0, 1000.0))
ax.set_title(’’)
ax.set_ylabel(‘Signal/#Events’)
ax.set_xlabel(‘Energy Transfer (meV)’)
ax.set_ylim(bottom=0.0, top=1000.0)
ax.set_xlim(left=-10, right=90.0)
mc.Show()