Skip to content

Commit

Permalink
Re #11422 Try to avoid zero for plots with -ve n
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew D Jones authored and Matthew D Jones committed Aug 11, 2015
1 parent 6e27860 commit a057cb9
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions Code/Mantid/MantidPlot/src/Graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1367,9 +1367,7 @@ void Graph::setAxisScale(int axis, double start, double end, int type, double st
}
else if (type == GraphOptions::Power)
{
g_log.debug() << "Axis type is: " << axis << std::endl;
g_log.debug() << "Start is: " << start << std::endl;
if (start <= 0)
if (start <= 0 && sc_engine->nthPower() < 0)
{
double s_min = DBL_MAX;
// for the y axis rely on the bounding rects
Expand Down Expand Up @@ -1400,15 +1398,15 @@ void Graph::setAxisScale(int axis, double start, double end, int type, double st
}
else
{
if (end <= 0)
{
start = 1;
end = 1000;
}
else
{
start = 0.01 * end;
}
start = 0.01 * end;
}
if (start == 0)
{
start = 0.01 * end;
}
else if (end == 0)
{
end = 0.01 * start;
}
}
}
Expand Down

0 comments on commit a057cb9

Please sign in to comment.