mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2024-11-15 10:05:47 +08:00
bugfix: parsed functions did not work properly
This commit is contained in:
parent
ba856b594f
commit
ebf034710b
@ -184,7 +184,11 @@ JKQTPEvaluatedFunctionGraphBase::PlotFunctorSpec JKQTPXParsedFunctionLineGraph::
|
||||
|
||||
jkqtpSimplePlotFunctionType plotFunction=std::bind(&JKQTPXParsedFunctionLineGraph::evaluateParsedFunction, std::placeholders::_1, &fdata);
|
||||
// the actual function to use
|
||||
spec.func=std::bind([=](double x) -> QPointF { return QPointF(0, plotFunction(x)); }, std::placeholders::_1);
|
||||
spec.func=std::bind([=](double x) -> QPointF { return QPointF(x, plotFunction(x)); }, std::placeholders::_1);
|
||||
|
||||
// range over which to evaluate func
|
||||
spec.range_start=parent->getXMin();
|
||||
spec.range_end=parent->getXMax();
|
||||
|
||||
return spec;
|
||||
}
|
||||
@ -292,11 +296,11 @@ JKQTPEvaluatedFunctionGraphBase::PlotFunctorSpec JKQTPYParsedFunctionLineGraph::
|
||||
|
||||
jkqtpSimplePlotFunctionType plotFunction=std::bind(&JKQTPXParsedFunctionLineGraph::evaluateParsedFunction, std::placeholders::_1, &fdata);
|
||||
// the actual function to use
|
||||
spec.func=std::bind([=](double y) -> QPointF { return QPointF(plotFunction(y), 0); }, std::placeholders::_1);
|
||||
spec.func=std::bind([=](double y) -> QPointF { return QPointF(plotFunction(y), y); }, std::placeholders::_1);
|
||||
|
||||
// range over which to evaluate func
|
||||
spec.range_start=parent->getXMin();
|
||||
spec.range_end=parent->getXMax();
|
||||
spec.range_start=parent->getYMin();
|
||||
spec.range_end=parent->getYMax();
|
||||
|
||||
return spec;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user