Skip to content
Snippets Groups Projects
Commit fdc14f5a authored by Antti Soininen's avatar Antti Soininen
Browse files

Fix issues with plotting cuts from dynamic susceptibility. Re #24011

parent 2f091c98
No related branches found
No related tags found
No related merge requests found
...@@ -55,7 +55,7 @@ def _configurematplotlib(params): ...@@ -55,7 +55,7 @@ def _configurematplotlib(params):
def _chooseylabel(workspace, axes): def _chooseylabel(workspace, axes):
"""Set the correct y label for profile axes.""" """Set the correct y label for profile axes."""
yUnitLabel = workspace.YUnitLabel() yUnitLabel = workspace.YUnitLabel()
if yUnitLabel == "X''(Q,E)": if yUnitLabel == "Dynamic susceptibility":
axes.set_ylabel(r"$\chi''(Q,E)$") axes.set_ylabel(r"$\chi''(Q,E)$")
elif yUnitLabel == 'g^{neutron}(E) (arb. units)': elif yUnitLabel == 'g^{neutron}(E) (arb. units)':
axes.set_ylabel(r'$g(E)$') axes.set_ylabel(r'$g(E)$')
...@@ -615,8 +615,7 @@ def plotcuts(direction, workspaces, cuts, widths, quantity, unit, style='l', kee ...@@ -615,8 +615,7 @@ def plotcuts(direction, workspaces, cuts, widths, quantity, unit, style='l', kee
if wsStr == '': if wsStr == '':
wsStr = str(wsCount) wsStr = str(wsCount)
quantityStr = _clearmath(quantity) quantityStr = _clearmath(quantity)
unitStr = _clearmath(unit) wsName = 'cut_{}_{}={}+-{}'.format(wsStr, quantityStr, cut, width,)
wsName = 'cut_{}_{}={}+-{}{}'.format(wsStr, quantityStr, cut, width, unitStr)
if keepCutWorkspaces: if keepCutWorkspaces:
cutWSList.append(wsName) cutWSList.append(wsName)
line = LineProfile(ws, cut, width, Direction=direction, line = LineProfile(ws, cut, width, Direction=direction,
...@@ -726,7 +725,6 @@ def plotSofQW(workspace, QMin=0., QMax=None, EMin=None, EMax=None, VMin=0., VMax ...@@ -726,7 +725,6 @@ def plotSofQW(workspace, QMin=0., QMax=None, EMin=None, EMax=None, VMin=0., VMax
logger.warning("The workspace '{}' does not look like proper S(Q,W) data. Trying to plot nonetheless.".format(str(workspace))) logger.warning("The workspace '{}' does not look like proper S(Q,W) data. Trying to plot nonetheless.".format(str(workspace)))
qHorizontal = workspace.getAxis(0).getUnit().name() == 'q' qHorizontal = workspace.getAxis(0).getUnit().name() == 'q'
isSusceptibility = workspace.YUnitLabel() == 'Dynamic susceptibility' isSusceptibility = workspace.YUnitLabel() == 'Dynamic susceptibility'
print(workspace.YUnit())
figure, axes = subplots() figure, axes = subplots()
if QMin is None: if QMin is None:
QMin = 0. QMin = 0.
......
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