Skip to content

Commit

Permalink
Fix error plotting when normalizing by the bin width.
Browse files Browse the repository at this point in the history
Refs #10639
  • Loading branch information
martyngigg committed Dec 3, 2014
1 parent 3e5f4a8 commit 28327fc
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Code/Mantid/MantidQt/API/src/QwtWorkspaceSpectrumData.cpp
Expand Up @@ -98,15 +98,18 @@ double QwtWorkspaceSpectrumData::ex(size_t i) const

double QwtWorkspaceSpectrumData::e(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]);
}
if (m_logScale)
{
if (m_Y[i] <= 0.0)
return 0;
else
return m_E[i];
double yi = (i < m_Y.size()) ? m_Y[i] : m_Y[m_Y.size()-1];
if (yi <= 0.0) return 0;
else return ei;
}
else
return m_E[i];
else return ei;
}

size_t QwtWorkspaceSpectrumData::esize() const
Expand Down

0 comments on commit 28327fc

Please sign in to comment.