Skip to content
Snippets Groups Projects
Commit 93dcad86 authored by Hahn, Steven's avatar Hahn, Steven
Browse files

Merge pull request #16536 from mantidproject/16012_plot_spectrum_upsidedown

 fabs for line grids which can be backward
parents aecbde37 c85bdcf0
No related branches found
No related tags found
No related merge requests found
......@@ -77,7 +77,7 @@ Return the y value of data point i
double QwtWorkspaceSpectrumData::getY(size_t i) const {
double tmp = i < m_Y.size() ? m_Y[i] : m_Y[m_Y.size() - 1];
if (m_isDistribution) {
tmp /= (m_X[i + 1] - m_X[i]);
tmp /= fabs(m_X[i + 1] - m_X[i]);
}
return tmp;
}
......@@ -89,7 +89,7 @@ double QwtWorkspaceSpectrumData::getEX(size_t i) const {
double QwtWorkspaceSpectrumData::getE(size_t i) const {
double ei = (i < m_E.size()) ? m_E[i] : m_E[m_E.size() - 1];
if (m_isDistribution) {
ei /= (m_X[i + 1] - m_X[i]);
ei /= fabs(m_X[i + 1] - m_X[i]);
}
return ei;
}
......@@ -132,4 +132,4 @@ operator=(const QwtWorkspaceSpectrumData &rhs) {
m_binCentres = rhs.m_binCentres;
}
return *this;
}
\ No newline at end of file
}
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