Skip to content

Commit

Permalink
Refs #9492. Compare Y units by caption instead of unitID
Browse files Browse the repository at this point in the history
Y units are always of type Label, hence unitID will always be the same
  • Loading branch information
arturbekasov committed May 22, 2014
1 parent 15fe471 commit c888f5c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Code/Mantid/MantidPlot/src/Graph.cpp
Expand Up @@ -3424,7 +3424,10 @@ PlotCurve* Graph::insertCurve(PlotCurve* c, int lineWidth, int curveType)
m_yUnits = mc->yUnits();
m_isDistribution = mc->isDistribution();
}
if ( m_xUnits->unitID() != mc->xUnits()->unitID() || m_yUnits->unitID() != mc->yUnits()->unitID() )
// Compare units. X units are compared by ID, Y units - by caption. That's because Y units will
// always be of type Label, hence will always have ID "Label", and the caption is what we are
// interested in.
if ( m_xUnits->unitID() != mc->xUnits()->unitID() || m_yUnits->caption() != mc->yUnits()->caption() )
{
g_log.warning("You are overlaying plots from data having differing units!");
}
Expand Down

0 comments on commit c888f5c

Please sign in to comment.