JKQTPlotter trunk/v5.0.0
an extensive Qt5+Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
Loading...
Searching...
No Matches
jkqtpevaluatedfunction.h
1/*
2 Copyright (c) 2008-2024 Jan W. Krieger (<jan@jkrieger.de>)
3
4
5
6 This software is free software: you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License (LGPL) as published by
8 the Free Software Foundation, either version 2.1 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU Lesser General Public License (LGPL) for more details.
15
16 You should have received a copy of the GNU Lesser General Public License (LGPL)
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef jkqtpgraphsevaluatedfunction_H
21#define jkqtpgraphsevaluatedfunction_H
22
23
24
25#include <QString>
26#include <QPainter>
27#include <QPair>
28#include "jkqtplotter/graphs/jkqtpscatter.h"
29#include "jkqtplotter/jkqtpgraphsbasestylingmixins.h"
30#include "jkqtplotter/jkqtplotter_imexport.h"
31#include "jkqtcommon/jkqtpgeometrytools.h"
32#include "jkqtplotter/graphs/jkqtpevaluatedfunctionbase.h"
33#include <functional>
34
35
36/** \brief This class extends JKQTPEvaluatedFunctionWithErrorsGraphBase with functions to draw the graphs and
37 * set the drawing style
38 * \ingroup jkqtplotter_functiongraphs
39 *
40 * \note Since this class is meant as a base for both f(x)- and f(y)-functions, it cannot
41 * implememt JKQTPGraph::draw(). Therefore it provides two implementations drawXGraph()
42 * and drawYGraph() and the user has to decide in the concrete graph class, which one to call
43 * (or whether to do the drawing completely different).
44 *
45 * \see e.g. JKQTPXFunctionLineGraph for a concrete implementation
46 */
48 Q_OBJECT
49 public:
50
51 /** \brief class constructor */
53
54 /** \brief class constructor */
56
57 /** \brief class destructor */
59
60 /** \brief plots a key marker inside the specified rectangle \a rect */
61 virtual void drawKeyMarker(JKQTPEnhancedPainter& painter, const QRectF& rect) override;
62 /** \brief returns the color to be used for the key label */
63 virtual QColor getKeyLabelColor() const override;
64
65
66
67 /** \copydoc drawErrorPolygons */
69 /** \copydoc drawErrorLines */
70 bool getDrawErrorLines() const;
71 /** \copydoc errorColor */
72 virtual QColor getErrorLineColor() const;
73 /** \copydoc errorFillColor */
74 virtual QColor getErrorFillColor() const;
75 /** \copydoc errorFillStyle */
76 virtual Qt::BrushStyle getErrorFillStyle() const;
77 /** \copydoc errorStyle */
78 virtual Qt::PenStyle getErrorLineStyle() const;
79 /** \copydoc errorLineWidth */
80 virtual double getErrorLineWidth() const;
81
82
83
84
85
86 public Q_SLOTS:
87 /** \brief set color, fill color and error color at the same time */
88 void setColor(QColor c);
89
90
91 /** \copydoc drawErrorPolygons */
92 void setDrawErrorPolygons(bool __value);
93 /** \copydoc drawErrorLines */
94 void setDrawErrorLines(bool __value);
95 /** \copydoc errorColor */
96 virtual void setErrorLineColor(const QColor & __value);
97 /** \copydoc errorFillColor */
98 virtual void setErrorFillColor(const QColor & __value);
99 /** \copydoc errorFillStyle */
100 virtual void setErrorFillStyle(Qt::BrushStyle __value);
101 /** \copydoc errorStyle */
102 virtual void setErrorLineStyle(Qt::PenStyle __value);
103 /** \copydoc errorLineWidth */
104 virtual void setErrorLineWidth(double __value);
105
106 protected:
107 /** \brief plots the graph to the plotter object specified as parent */
109 /** \brief plots the graph to the plotter object specified as parent */
111
112
113
114
115 /** \brief indicates whether an error polygon should be drawn */
117 /** \brief indicates whether error lines should be drawn */
119
120
121
122 /** \brief color of the error graph */
124 /** \brief color of the error graph fill */
126 /** \brief linestyle of the error graph lines */
127 Qt::PenStyle errorStyle;
128 /** \brief width (pixels) of the error graph */
130 /** \brief fill style, if the error curve should be filled */
131 Qt::BrushStyle errorFillStyle;
132
133
134 QBrush getErrorBrush(JKQTPEnhancedPainter& painter) const;
136
137};
138
139
140
141/*! \brief type of functions that may be plotted by JKQTPXFunctionLineGraph and JKQTPYFunctionLineGraph
142 \ingroup jkqtplotter_functiongraphs
143
144 This is the type of functions \f$ y=f(x, \vec{p}) \f$ that may be plottet by JKQTPXFunctionLineGraph
145 and JKQTPYFunctionLineGraph. It is possible to supply parameters \f$ \vec{p} \f$ to the function that
146 influence its result. Parameters are given as a pointer to some memory location. The function has to
147 know on its own how to interpret these.
148*/
149typedef std::function<double(double, const QVector<double>&)> jkqtpPlotFunctionType;
150
151/*! \brief simplified type of functions (without parameters) that may be plotted by JKQTPXFunctionLineGraph and JKQTPYFunctionLineGraph
152 \ingroup jkqtplotter_functiongraphs
153
154 This is the type of functions \f$ y=f(x) \f$ that may be plottet by JKQTPXFunctionLineGraph
155 and JKQTPYFunctionLineGraph.
156*/
157typedef std::function<double(double)> jkqtpSimplePlotFunctionType;
158
159
160
161/** \brief extends JKQTPEvaluatedFunctionWithErrorsGraphDrawingBase with the capabilities to define functions from C++-functors
162 * of type jkqtpSimplePlotFunctionType or jkqtpPlotFunctionType
163 * \ingroup jkqtplotter_functiongraphs
164 *
165 * \see JKQTPXFunctionLineGraph and JKQTPYFunctionLineGraph for a concrete implementation
166 */
168 Q_OBJECT
169 public:
171 Polynomial, /*!< \brief a polynomial \f$ f(x)=p_0+p_1x+p_2x^2+p_3x^3+... \f$ The parameters \a params have to be point to a QVector<double> and contain the parameters \f$ p_0, p_1, ... \f$ */
172 Line=Polynomial, /*!< \brief a polynomial \f$ f(x)=p_0+p_1x \f$ The parameters \a params have to be point to a QVector<double> and contain the parameters \f$ p_0, p_1, ... \f$ */
173 Exponential, /*!< \brief an exponential function \f$ f(x)=p_0+p_1\cdot\exp(x/p_2) \f$ or \f$ f(x)=p_0\cdot\exp(x/p_1) \f$ (depending on the number of parameters). The parameters \a params have to be point to a QVector<double> and contain the parameters \f$ p_0, p_1, ... \f$ */
174 PowerLaw, /*!< \brief an exponential function \f$ f(x)=p_0+p_1\cdot x^{p_3} \f$ or \f$ f(x)=p_0\cdot x^{p_1} \f$ or \f$ f(x)= x^{p_0} \f$ (depending on the number of parameters) The parameters \a params have to be point to a QVector<double> and contain the parameters \f$ p_0, p_1, ... \f$ */
175 };
176
177 /** \brief class constructor */
179
180 /** \brief class constructor */
182 /** \brief class constructor */
183 JKQTPFunctorLineGraphBase(const jkqtpSimplePlotFunctionType & f, const QString& title, JKQTBasePlotter* parent=nullptr);
184 /** \brief class constructor */
185 JKQTPFunctorLineGraphBase(const jkqtpSimplePlotFunctionType & f, const QString& title, JKQTPlotter* parent);
186 /** \brief class constructor */
187 JKQTPFunctorLineGraphBase(jkqtpSimplePlotFunctionType && f, const QString& title, JKQTBasePlotter* parent=nullptr);
188 /** \brief class constructor */
190 /** \brief class constructor */
191 JKQTPFunctorLineGraphBase(SpecialFunction type, const QVector<double>& params, const QString& title, JKQTBasePlotter* parent);
192 /** \brief class constructor */
193 JKQTPFunctorLineGraphBase(SpecialFunction type, const QVector<double>& params, const QString& title, JKQTPlotter* parent);
194
195 /** \brief class destructor */
196 virtual ~JKQTPFunctorLineGraphBase() override;
197
198 /** \brief sets a functor to be plotted
199 *
200 * \see plotFunction
201 */
203 /** \brief sets a functor to be plotted
204 *
205 * \see plotFunction
206 */
207 virtual void setPlotFunctionFunctor (const jkqtpPlotFunctionType & __value);
208 /** \brief sets a functor to be plotted
209 *
210 * \see simplePlotFunction
211 */
213 /** \brief sets a functor to be plotted
214 *
215 * \see simplePlotFunction
216 */
218 /*! \copydoc plotFunction
219 *
220 * \see isSimplePlotFunction() */ \
222 /*! \copydoc simplePlotFunction
223 *
224 * \see isSimplePlotFunction() */ \
226
227 /** \brief returns whether the plot function was defined as a jkqtpSimpleParametricCurveFunctionType (\c true ) or
228 * a jkqtpParametricCurveFunctionType (\c false ) */
230
231
232 /** \brief sets a functor to be used for calculating errors
233 *
234 * \see errorPlotFunction
235 */
237 /** \brief sets a functor to be used for calculating errors
238 *
239 * \see errorPlotFunction
240 */
241 virtual void setErrorPlotFunction (const jkqtpPlotFunctionType & __value);
242 /** \copydoc errorPlotFunction */ \
244 /** \brief sets a functor to be used for calculating errors
245 *
246 * \see errorSimplePlotFunction
247 */
249 /** \brief sets a functor to be used for calculating errors
250 *
251 * \see errorSimplePlotFunction
252 */
253 virtual void setErrorPlotFunction (const jkqtpSimplePlotFunctionType & __value);
254 /** \copydoc errorSimplePlotFunction */ \
256
257
258
259 /** \brief sets function to the given special function */
261 protected:
262 /** \brief the function to be plotted */
264 /** \brief a simple function to be plotted, simplified form without parameters */
266
267
268 /** \brief this function calculates the error at a given position */
270 /** \brief this function calculates the error at a given position, simplified form without parameters */
272};
273
274
275/*! \brief This implements line plots where the data is taken from a user supplied function \f$ y=f(x) \f$
276 \ingroup jkqtplotter_functiongraphs
277
278 This class uses the intelligent plotting algorithm for functions, implemented in JKQTPAdaptiveFunctionGraphEvaluator.
279
280 The following image shows some example graphs:
281
282 \image html plot_functionplots.png
283
284 \note Auto-scaling of the plot is deactivated (by overwriting getXMinMax() and getYMinMax() to return \c false ), as it depends on the axes (hen-egg-problem!)
285 Set the plot-ranges by hand!!!
286
287 \see \ref JKQTPlotterFunctionPlots, JKQTPAdaptiveFunctionGraphEvaluator, JKQTPYFunctionLineGraph, JKQTPXYFunctionLineGraph, jkqtpstatAddPolyFit(), jkqtpstatAddWeightedRegression(), jkqtpstatAddRobustIRLSRegression(), jkqtpstatAddRegression(), jkqtpstatAddLinearWeightedRegression(), jkqtpstatAddRobustIRLSLinearRegression(), jkqtpstatAddLinearRegression()
288 */
290 Q_OBJECT
291 public:
292
293
294 /** \brief class constructor */
296
297 /** \brief class constructor */
299 /** \brief class constructor */
300 JKQTPXFunctionLineGraph(const jkqtpSimplePlotFunctionType & f, const QString& title, JKQTBasePlotter* parent=nullptr);
301 /** \brief class constructor */
302 JKQTPXFunctionLineGraph(const jkqtpSimplePlotFunctionType & f, const QString& title, JKQTPlotter* parent);
303 /** \brief class constructor */
304 JKQTPXFunctionLineGraph(jkqtpSimplePlotFunctionType && f, const QString& title, JKQTBasePlotter* parent=nullptr);
305 /** \brief class constructor */
307 /** \brief class constructor */
308 JKQTPXFunctionLineGraph(SpecialFunction type, const QVector<double>& params, const QString& title, JKQTBasePlotter* parent);
309 /** \brief class constructor */
310 JKQTPXFunctionLineGraph(SpecialFunction type, const QVector<double>& params, const QString& title, JKQTPlotter* parent);
311
312 /** \brief class destructor */
313 virtual ~JKQTPXFunctionLineGraph() override;
314
315 /** \brief plots the graph to the plotter object specified as parent */
316 virtual void draw(JKQTPEnhancedPainter& painter) override;
317
318 protected:
319
320 /** \copydoc JKQTPEvaluatedFunctionGraphBase::buildPlotFunctorSpec() */
322
323 /** \copydoc JKQTPEvaluatedFunctionWithErrorsGraphBase::buildPlotFunctorSpec() */
324 virtual std::function<QPointF(double)> buildErrorFunctorSpec() override;
325
326 /** \copydoc JKQTPPlotElement::getXMinMax() */
327 virtual bool getXMinMax(double& minx, double& maxx, double& smallestGreaterZero) override;
328 /** \copydoc JKQTPPlotElement::getYMinMax() */
329 virtual bool getYMinMax(double& miny, double& maxy, double& smallestGreaterZero) override;
330
331
332};
333
334/*! \brief This implements line plots where the data is taken from a user supplied function \f$ x=f(y) \f$
335 \ingroup jkqtplotter_functiongraphs
336
337 The following image shows some example graphs:
338
339 \image html functionplot_fy.png
340
341 \note Auto-scaling of the plot is deactivated (by overwriting getXMinMax() and getYMinMax() to return \c false ), as it depends on the axes (hen-egg-problem!)
342 Set the plot-ranges by hand!!!
343
344 \see \ref JKQTPlotterFunctionPlots , JKQTPXFunctionLineGraph, JKQTPXYFunctionLineGraph
345 */
347 Q_OBJECT
348 public:
349 /** \brief class constructor */
351 /** \brief class constructor */
353 /** \brief class constructor */
354 JKQTPYFunctionLineGraph(const jkqtpSimplePlotFunctionType & f, const QString& title, JKQTBasePlotter* parent=nullptr);
355 /** \brief class constructor */
356 JKQTPYFunctionLineGraph(const jkqtpSimplePlotFunctionType & f, const QString& title, JKQTPlotter* parent);
357 /** \brief class constructor */
358 JKQTPYFunctionLineGraph(jkqtpSimplePlotFunctionType && f, const QString& title, JKQTBasePlotter* parent=nullptr);
359 /** \brief class constructor */
361 /** \brief class constructor */
362 JKQTPYFunctionLineGraph(SpecialFunction type, const QVector<double>& params, const QString& title, JKQTBasePlotter* parent);
363 /** \brief class constructor */
364 JKQTPYFunctionLineGraph(SpecialFunction type, const QVector<double>& params, const QString& title, JKQTPlotter* parent);
365
366 /** \brief plots the graph to the plotter object specified as parent */
367 virtual void draw(JKQTPEnhancedPainter& painter) override;
368 protected:
369
370 /** \copydoc JKQTPEvaluatedFunctionGraphBase::buildPlotFunctorSpec() */
372
373 /** \copydoc JKQTPEvaluatedFunctionWithErrorsGraphBase::buildPlotFunctorSpec() */
374 virtual std::function<QPointF(double)> buildErrorFunctorSpec() override;
375
376
377 /** \copydoc JKQTPPlotElement::getXMinMax() */
378 virtual bool getXMinMax(double& minx, double& maxx, double& smallestGreaterZero) override;
379 /** \copydoc JKQTPPlotElement::getYMinMax() */
380 virtual bool getYMinMax(double& miny, double& maxy, double& smallestGreaterZero) override;
381
382
383};
384
385
386
387
388#endif // jkqtpgraphsevaluatedfunction_H
base class for 2D plotter classes (used by the plotter widget JKQTPlotter)
Definition jkqtpbaseplotter.h:394
this class extends the QPainter
Definition jkqtpenhancedpainter.h:33
extends JKQTPEvaluatedFunctionGraphBase with some basic properties (e.g. function parameters) for a s...
Definition jkqtpevaluatedfunctionbase.h:232
This class extends JKQTPEvaluatedFunctionWithErrorsGraphBase with functions to draw the graphs and se...
Definition jkqtpevaluatedfunction.h:47
bool drawErrorLines
indicates whether error lines should be drawn
Definition jkqtpevaluatedfunction.h:118
void drawYGraph(JKQTPEnhancedPainter &painter)
plots the graph to the plotter object specified as parent
virtual void setErrorLineColor(const QColor &__value)
color of the error graph
virtual void drawKeyMarker(JKQTPEnhancedPainter &painter, const QRectF &rect) override
plots a key marker inside the specified rectangle rect
virtual void setErrorLineWidth(double __value)
width (pixels) of the error graph
virtual ~JKQTPEvaluatedFunctionWithErrorsGraphDrawingBase() override
class destructor
void drawXGraph(JKQTPEnhancedPainter &painter)
plots the graph to the plotter object specified as parent
virtual QColor getErrorLineColor() const
color of the error graph
double errorLineWidth
width (pixels) of the error graph
Definition jkqtpevaluatedfunction.h:129
virtual QColor getKeyLabelColor() const override
returns the color to be used for the key label
JKQTPEvaluatedFunctionWithErrorsGraphDrawingBase(JKQTBasePlotter *parent=nullptr)
class constructor
Qt::BrushStyle errorFillStyle
fill style, if the error curve should be filled
Definition jkqtpevaluatedfunction.h:131
virtual Qt::PenStyle getErrorLineStyle() const
linestyle of the error graph lines
QColor errorColor
color of the error graph
Definition jkqtpevaluatedfunction.h:123
void setDrawErrorLines(bool __value)
indicates whether error lines should be drawn
QPen getErrorLinePen(JKQTPEnhancedPainter &painter) const
Qt::PenStyle errorStyle
linestyle of the error graph lines
Definition jkqtpevaluatedfunction.h:127
virtual void setErrorFillStyle(Qt::BrushStyle __value)
fill style, if the error curve should be filled
virtual void setErrorFillColor(const QColor &__value)
color of the error graph fill
virtual void setErrorLineStyle(Qt::PenStyle __value)
linestyle of the error graph lines
bool getDrawErrorPolygons() const
indicates whether an error polygon should be drawn
bool getDrawErrorLines() const
indicates whether error lines should be drawn
void setDrawErrorPolygons(bool __value)
indicates whether an error polygon should be drawn
bool drawErrorPolygons
indicates whether an error polygon should be drawn
Definition jkqtpevaluatedfunction.h:116
virtual Qt::BrushStyle getErrorFillStyle() const
fill style, if the error curve should be filled
void setColor(QColor c)
set color, fill color and error color at the same time
JKQTPEvaluatedFunctionWithErrorsGraphDrawingBase(JKQTPlotter *parent)
class constructor
QColor errorFillColor
color of the error graph fill
Definition jkqtpevaluatedfunction.h:125
QBrush getErrorBrush(JKQTPEnhancedPainter &painter) const
virtual double getErrorLineWidth() const
width (pixels) of the error graph
virtual QColor getErrorFillColor() const
color of the error graph fill
extends JKQTPEvaluatedFunctionWithErrorsGraphDrawingBase with the capabilities to define functions fr...
Definition jkqtpevaluatedfunction.h:167
virtual void setPlotFunctionFunctor(jkqtpSimplePlotFunctionType &&__value)
sets a functor to be plotted
jkqtpSimplePlotFunctionType errorSimplePlotFunction
this function calculates the error at a given position, simplified form without parameters
Definition jkqtpevaluatedfunction.h:271
jkqtpSimplePlotFunctionType simplePlotFunction
a simple function to be plotted, simplified form without parameters
Definition jkqtpevaluatedfunction.h:265
virtual jkqtpSimplePlotFunctionType getErrorSimplePlotFunction() const
this function calculates the error at a given position, simplified form without parameters
JKQTPFunctorLineGraphBase(const jkqtpSimplePlotFunctionType &f, const QString &title, JKQTBasePlotter *parent=nullptr)
class constructor
virtual void setPlotFunctionFunctor(jkqtpPlotFunctionType &&__value)
sets a functor to be plotted
virtual void setErrorPlotFunction(jkqtpSimplePlotFunctionType &&__value)
sets a functor to be used for calculating errors
void setSpecialFunction(SpecialFunction function)
sets function to the given special function
bool isSimplePlotFunction() const
returns whether the plot function was defined as a jkqtpSimpleParametricCurveFunctionType (true ) or ...
JKQTPFunctorLineGraphBase(SpecialFunction type, const QVector< double > &params, const QString &title, JKQTPlotter *parent)
class constructor
virtual void setPlotFunctionFunctor(const jkqtpSimplePlotFunctionType &__value)
sets a functor to be plotted
virtual void setErrorPlotFunction(const jkqtpPlotFunctionType &__value)
sets a functor to be used for calculating errors
SpecialFunction
Definition jkqtpevaluatedfunction.h:170
@ PowerLaw
an exponential function or or (depending on the number of parameters) The parameters params have t...
Definition jkqtpevaluatedfunction.h:174
@ Exponential
an exponential function or (depending on the number of parameters). The parameters params have to b...
Definition jkqtpevaluatedfunction.h:173
@ Polynomial
a polynomial The parameters params have to be point to a QVector<double> and contain the parameters
Definition jkqtpevaluatedfunction.h:171
JKQTPFunctorLineGraphBase(jkqtpSimplePlotFunctionType &&f, const QString &title, JKQTBasePlotter *parent=nullptr)
class constructor
virtual void setPlotFunctionFunctor(const jkqtpPlotFunctionType &__value)
sets a functor to be plotted
JKQTPFunctorLineGraphBase(JKQTBasePlotter *parent=nullptr)
class constructor
jkqtpPlotFunctionType plotFunction
the function to be plotted
Definition jkqtpevaluatedfunction.h:263
virtual ~JKQTPFunctorLineGraphBase() override
class destructor
virtual jkqtpSimplePlotFunctionType getSimplePlotFunction() const
a simple function to be plotted, simplified form without parameters
virtual void setErrorPlotFunction(const jkqtpSimplePlotFunctionType &__value)
sets a functor to be used for calculating errors
JKQTPFunctorLineGraphBase(jkqtpSimplePlotFunctionType &&f, const QString &title, JKQTPlotter *parent)
class constructor
virtual void setErrorPlotFunction(jkqtpPlotFunctionType &&__value)
sets a functor to be used for calculating errors
virtual jkqtpPlotFunctionType getPlotFunctionFunctor() const
the function to be plotted
JKQTPFunctorLineGraphBase(JKQTPlotter *parent)
class constructor
JKQTPFunctorLineGraphBase(SpecialFunction type, const QVector< double > &params, const QString &title, JKQTBasePlotter *parent)
class constructor
jkqtpPlotFunctionType errorPlotFunction
this function calculates the error at a given position
Definition jkqtpevaluatedfunction.h:269
virtual jkqtpPlotFunctionType getErrorPlotFunction() const
this function calculates the error at a given position
JKQTPFunctorLineGraphBase(const jkqtpSimplePlotFunctionType &f, const QString &title, JKQTPlotter *parent)
class constructor
This Mix-In class provides setter/getter methods, storage and other facilities for the graph line and...
Definition jkqtpgraphsbasestylingmixins.h:595
This implements line plots where the data is taken from a user supplied function .
Definition jkqtpevaluatedfunction.h:289
JKQTPXFunctionLineGraph(SpecialFunction type, const QVector< double > &params, const QString &title, JKQTBasePlotter *parent)
class constructor
virtual ~JKQTPXFunctionLineGraph() override
class destructor
virtual PlotFunctorSpec buildPlotFunctorSpec() override
this function returns a functor that is used to generate the plot data in coordinate space,...
JKQTPXFunctionLineGraph(JKQTPlotter *parent)
class constructor
JKQTPXFunctionLineGraph(const jkqtpSimplePlotFunctionType &f, const QString &title, JKQTPlotter *parent)
class constructor
JKQTPXFunctionLineGraph(JKQTBasePlotter *parent=nullptr)
class constructor
virtual bool getYMinMax(double &miny, double &maxy, double &smallestGreaterZero) override
get the maximum and minimum y-value of the graph
virtual void draw(JKQTPEnhancedPainter &painter) override
plots the graph to the plotter object specified as parent
JKQTPXFunctionLineGraph(jkqtpSimplePlotFunctionType &&f, const QString &title, JKQTPlotter *parent)
class constructor
JKQTPXFunctionLineGraph(jkqtpSimplePlotFunctionType &&f, const QString &title, JKQTBasePlotter *parent=nullptr)
class constructor
JKQTPXFunctionLineGraph(SpecialFunction type, const QVector< double > &params, const QString &title, JKQTPlotter *parent)
class constructor
JKQTPXFunctionLineGraph(const jkqtpSimplePlotFunctionType &f, const QString &title, JKQTBasePlotter *parent=nullptr)
class constructor
virtual std::function< QPointF(double)> buildErrorFunctorSpec() override
this function returns a functor that is used to generate the plot data in coordinate space,...
virtual bool getXMinMax(double &minx, double &maxx, double &smallestGreaterZero) override
get the maximum and minimum x-value of the graph
This implements line plots where the data is taken from a user supplied function .
Definition jkqtpevaluatedfunction.h:346
virtual void draw(JKQTPEnhancedPainter &painter) override
plots the graph to the plotter object specified as parent
virtual bool getXMinMax(double &minx, double &maxx, double &smallestGreaterZero) override
get the maximum and minimum x-value of the graph
virtual std::function< QPointF(double)> buildErrorFunctorSpec() override
this function returns a functor that is used to generate the plot data in coordinate space,...
JKQTPYFunctionLineGraph(const jkqtpSimplePlotFunctionType &f, const QString &title, JKQTPlotter *parent)
class constructor
JKQTPYFunctionLineGraph(jkqtpSimplePlotFunctionType &&f, const QString &title, JKQTBasePlotter *parent=nullptr)
class constructor
JKQTPYFunctionLineGraph(JKQTBasePlotter *parent=nullptr)
class constructor
JKQTPYFunctionLineGraph(SpecialFunction type, const QVector< double > &params, const QString &title, JKQTBasePlotter *parent)
class constructor
virtual PlotFunctorSpec buildPlotFunctorSpec() override
this function returns a functor that is used to generate the plot data in coordinate space,...
JKQTPYFunctionLineGraph(JKQTPlotter *parent)
class constructor
virtual bool getYMinMax(double &miny, double &maxy, double &smallestGreaterZero) override
get the maximum and minimum y-value of the graph
JKQTPYFunctionLineGraph(jkqtpSimplePlotFunctionType &&f, const QString &title, JKQTPlotter *parent)
class constructor
JKQTPYFunctionLineGraph(SpecialFunction type, const QVector< double > &params, const QString &title, JKQTPlotter *parent)
class constructor
JKQTPYFunctionLineGraph(const jkqtpSimplePlotFunctionType &f, const QString &title, JKQTBasePlotter *parent=nullptr)
class constructor
plotter widget for scientific plots (uses JKQTBasePlotter to do the actual drawing)
Definition jkqtplotter.h:364
std::function< double(double)> jkqtpSimplePlotFunctionType
simplified type of functions (without parameters) that may be plotted by JKQTPXFunctionLineGraph and ...
Definition jkqtpevaluatedfunction.h:157
std::function< double(double, const QVector< double > &)> jkqtpPlotFunctionType
type of functions that may be plotted by JKQTPXFunctionLineGraph and JKQTPYFunctionLineGraph
Definition jkqtpevaluatedfunction.h:149
#define JKQTPLOTTER_LIB_EXPORT
Definition jkqtplotter_imexport.h:89
specifies an internal plot functor
Definition jkqtpevaluatedfunctionbase.h:152