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
jkqtpscatter.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 jkqtpscatter_H
21#define jkqtpscatter_H
22
23
24#include <QString>
25#include <QPainter>
26#include <QPair>
27#include <functional>
28#include "jkqtplotter/jkqtptools.h"
29#include "jkqtplotter/jkqtplotter_imexport.h"
30#include "jkqtcommon/jkqtpdrawingtools.h"
31#include "jkqtplotter/jkqtpgraphsbase.h"
32#include "jkqtcommon/jkqtpenhancedpainter.h"
33#include "jkqtplotter/jkqtpgraphsbaseerrors.h"
34#include "jkqtplotter/graphs/jkqtprange.h"
35#include "jkqtplotter/graphs/jkqtplines.h"
36#include "jkqtplotter/jkqtpgraphsbasestylingmixins.h"
37
38// forward declarations
39class JKQTBasePlotter;
40class JKQTPlotter;
42class JKQTPDatastore;
43//class JKQTPColorPaletteStyleAndToolsMixin;
44
45
46
47
48/*! \brief This implements xy scatter plots. This also alows to draw symbols at the data points.
49 \ingroup jkqtplotter_linesymbolgraphs_scatter
50
51 \image html JKQTPXYScatterGraph.png
52
53 \note This classes can (and does by default) apply a line-compression strategy that improves plotting speed
54 but reduces accuracy a bit. See JKQTPGraphLinesCompressionMixin for details.
55
56 \see JKQTPXYScatterErrorGraph for a version with error indicators and JKQTPXYParametrizedScatterGraph for a more feature-rich version
57 that allows to also change the color/size of the symbols from data
58 */
60 Q_OBJECT
61 public:
62 /** \brief class constructor */
63 explicit JKQTPXYScatterGraph(JKQTBasePlotter* parent=nullptr);
64 /** \brief class constructor */
66
67 /** \brief plots the graph to the plotter object specified as parent */
68 virtual void draw(JKQTPEnhancedPainter& painter) override;
69 /** \brief plots a key marker inside the specified rectangle \a rect */
70 virtual void drawKeyMarker(JKQTPEnhancedPainter& painter, const QRectF& rect) override;
71 /** \brief returns the color to be used for the key label */
72 virtual QColor getKeyLabelColor() const override;
73 /** \brief set color of line and symbol */
74 void setColor(QColor c);
75
76 protected:
77
78
79
80
81
82};
83
84
85
86
87
88
89/*! \brief This implements xy scatter plots with x and y error indicators.
90 \ingroup jkqtplotter_linesymbolgraphs_scatter
91
92 \image html JKQTPXYScatterErrorGraph.png
93
94 \see JKQTPXYScatterGraph, JKQTPXYGraphErrors
95 */
97 Q_OBJECT
98 public:
99 /** \brief class constructor */
101 /** \brief class constructor */
103
104 /** \copydoc JKQTPPlotElement::getXMinMax() */
105 virtual bool getXMinMax(double& minx, double& maxx, double& smallestGreaterZero) override;
106 /** \copydoc JKQTPPlotElement::getYMinMax() */
107 virtual bool getYMinMax(double& miny, double& maxy, double& smallestGreaterZero) override;
108 /** \copydoc JKQTPGraph::usesColumn() */
109 virtual bool usesColumn(int c) const override;
110
111 protected:
112 /** \brief this function is used to plot error inidcators before plotting the graphs. */
113 virtual void drawErrorsBefore(JKQTPEnhancedPainter& painter) override;
114};
115
116
117
118
119
120
121
122
123/*! \brief This implements xy scatter plots (like JKQTPXYScatterGraph), but the color and size of the symbols may be taken from a column.
124 \ingroup jkqtplotter_linesymbolgraphs_param
125
126 set the properties sizeColumn and/or colorColumn to change the size and/or color of the symbols according to the values in the column.
127
128 \image html paramscatterplot.png "Different Styles of Parametrized Scatter/Line Graphs"
129
130 \note This classes is meant for cases where you want to change the color/size/... of single symbols, in dependence
131 of data. If you are looking for a simple scatter-plot without data-dependent properties, use JKQTPXYScatterGraph
132 instead, which is faster.
133
134 \note For the size, line width and symbol type columns, you can also set a functor, which converts the column value (optionally based
135 also on the x- and y-location of the data point) into the local symbol size, symbol type or line width. Use the functions
136 setLinewidthColumnFunctor(), setSymbolColumnFunctor() and setSizeColumnFunctor() to set these functors. This feature gives you
137 even more control over the modification of the plot elements. Initially all functors are set to default values, that do not add
138 any additional transformations.
139 \image html JKQTPXYParametrizedScatterGraph_LinewidthFunctor.png
140 \image html JKQTPXYParametrizedScatterGraph_SymbolFunctor.png
141
142 \image html paramscatterplot_image_star.png "JKQTPXYParametrizedScatterGraph with symbols organized in a grid"
143
144
145 \see JKQTPXYParametrizedErrorScatterGraph, \ref JKQTPlotterParamScatter , \ref JKQTPlotterParamScatterImage, \ref JKQTPlotterParametricCurves
146*/
148 Q_OBJECT
149 public:
150 /** \brief functor, which converts the value of the symbol column (at a location x,y) into a JKQTPGraphSymbols */
151 typedef std::function<JKQTPGraphSymbols(double x, double y, double symcolumn)> FunctorToSymbol;
152 /** \brief functor, which converts the value of the line width column (at a location x,y) into a line width (in pt) */
153 typedef std::function<double(double x, double y, double widcolumn)> FunctorToWidth;
154 /** \brief functor, which converts the value of the line size column (at a location x,y) into a symbol size (in pt) */
155 typedef std::function<double(double x, double y, double sizecolumn)> FunctorToSize;
156
157 /** \brief class constructor */
159 /** \brief class constructor */
161
162 /** \brief plots the graph to the plotter object specified as parent */
163 virtual void draw(JKQTPEnhancedPainter& painter) override;
164 /** \brief plots a key marker inside the specified rectangle \a rect */
165 virtual void drawKeyMarker(JKQTPEnhancedPainter& painter, const QRectF& rect) override;
166 /** \brief returns the color to be used for the key label */
167 virtual QColor getKeyLabelColor() const override;
168
169 /** \copydoc sizeColumn */
170 void setSizeColumn(int __value);
171 /** \copydoc sizeColumn */
172 void setSizeColumn (size_t __value);
173 /** \copydoc sizeColumn */
174 int getSizeColumn() const;
175 /** \brief defines a functor, which converts a value from the sizeColumn into an actual symbol size in pt
176 *
177 * \code
178 * graph6->setSizeColumnFunctor([](double x, double y, double w) {
179 * return fabs(sin(w/3.0)*25.0);
180 * });
181 * \endcode
182 *
183 * \see setSizeColumnFunctor(), clearSizeColumnFunctor() and getSizeColumnFunctor()
184 */
186 /** \brief defines a standard (1:1) functor, which converts a value from the sizeColumn into an actual symbol size in pt
187 * \see setSizeColumnFunctor(), clearSizeColumnFunctor() and getSizeColumnFunctor()
188 */
190 /** \brief returns the current functor, which converts a value from the sizeColumn into an actual symbol size in pt
191 * \see setSizeColumnFunctor(), clearSizeColumnFunctor() and getSizeColumnFunctor()
192 */
194
195
196 /** \copydoc colorColumn */
197 void setColorColumn(int __value);
198 /** \copydoc colorColumn */
199 int getColorColumn() const;
200 /** \copydoc colorColumn */
201 void setColorColumn (size_t __value);
202
203
204 /** \copydoc symbolColumn */
205 void setSymbolColumn(int __value);
206 /** \copydoc symbolColumn */
207 int getSymbolColumn() const;
208 /** \copydoc symbolColumn */
209 void setSymbolColumn (size_t __value);
210 /** \brief defines a functor, which converts a value from the symbolColumn into an actual symbol type
211 *
212 * \code
213 * graph1->setSymbolColumnFunctor([](double x, double y, double sym) -> JKQTPGraphSymbols {
214 * if (sym<Ndata/2) {
215 * return JKQTPGraphSymbols::JKQTPCircle;
216 * } else if (sym>Ndata/2) {
217 * return JKQTPGraphSymbols::JKQTPFilledCircle;
218 * } else {
219 * return JKQTPGraphSymbols::JKQTPPlus;
220 * }
221 * });
222 * \endcode
223 *
224 * \image html JKQTPXYParametrizedScatterGraph_SymbolFunctor.png
225 * \see setSymbolColumnFunctor(), clearSymbolColumnFunctor() and getSymbolColumnFunctor(), setMappedSymbolColumnFunctor(), \ref JKQTPlotterParamScatter
226 */
228 /** \brief defines a standard (1:1) functor, which converts a value from the symbolColumn into an actual symbol type
229 * \image html JKQTPXYParametrizedScatterGraph_SymbolFunctor.png
230 * \see setSymbolColumnFunctor(), clearSymbolColumnFunctor() and getSymbolColumnFunctor(), setMappedSymbolColumnFunctor(), \ref JKQTPlotterParamScatter
231 */
233 /** \brief defines a special functor, which converts a value from the symbolColumn into an actual symbol type,
234 * where the relation between value and symbol is defined by a map double->symbol
235 *
236 * This generates a special functor, which will convert values to symbols by using the values from the given map
237 * and these rules:
238 * - everything below the smallest value is mapped to the smallest value's symbol
239 * - everything abive the largest value is mapped to the largest value's symbol
240 * - everything in between is mapped to the symbol of the value closest to the actual value
241 * .
242 *
243 * \code
244 * QMap<double, JKQTPGraphSymbols> mapped;
245 * mapped[0]=JKQTPGraphSymbols::JKQTPCircle;
246 * mapped[5]=JKQTPGraphSymbols::JKQTPFilledCircle;
247 * mapped[10]=JKQTPGraphSymbols::JKQTPPlus;
248 * graph1->setMappedSymbolColumnFunctor(mapped);
249 * \endcode
250 *
251 * \see setSymbolColumnFunctor(), clearSymbolColumnFunctor() and getSymbolColumnFunctor(), setMappedSymbolColumnFunctor(), \ref JKQTPlotterParamScatter
252 */
253 void setMappedSymbolColumnFunctor(const QMap<double, JKQTPGraphSymbols>& symmap);
254 /** \brief returns the current functor, which converts a value from the symbolColumn into an actual symbol type
255 * \see setSymbolColumnFunctor(), clearSymbolColumnFunctor() and getSymbolColumnFunctor(), setMappedSymbolColumnFunctor(), \ref JKQTPlotterParamScatter
256 */
258
259
260 /** \copydoc linewidthColumn */
261 void setLinewidthColumn(int __value);
262 /** \copydoc linewidthColumn */
264 /** \copydoc linewidthColumn */
265 void setLinewidthColumn( size_t __value);
266 /** \brief defines a functor, which converts a value from the symbolColumn into an actual line width in pt
267 *
268 * \code
269 * graph6->setLinewidthColumnFunctor([](double x, double y, double w) {
270 * return fabs(sin(w/3.0)*25.0);
271 * });
272 * \endcode
273 *
274 * \image html JKQTPXYParametrizedScatterGraph_LinewidthFunctor.png
275 *
276 * \see setLinewidthColumnFunctor(), clearLinewidthColumnFunctor() and getLinewidthColumnFunctor(), \ref JKQTPlotterParamScatter
277 */
279 /** \brief defines a standard (1:1) functor, which converts a value from the symbolColumn into an actual line width in pt
280 *
281 * \image html JKQTPXYParametrizedScatterGraph_LinewidthFunctor.png
282 *
283 * \see setLinewidthColumnFunctor(), clearLinewidthColumnFunctor() and getLinewidthColumnFunctor(), \ref JKQTPlotterParamScatter
284 */
286 /** \brief returns the current functor, which converts a value from the symbolColumn into an actual line width in pt
287 * \see setLinewidthColumnFunctor(), clearLinewidthColumnFunctor() and getLinewidthColumnFunctor(), \ref JKQTPlotterParamScatter
288 */
290
291
292
293
294 /** \copydoc colorColumnContainsRGB */
295 void setColorColumnContainsRGB(bool __value);
296 /** \copydoc colorColumnContainsRGB */
298
299 /** \copydoc gridModeForSymbolSize */
300 void setGridModeForSymbolSize(bool __value);
301 /** \copydoc gridModeForSymbolSize */
303 /** \copydoc gridDeltaX */
304 void setGridDeltaX(double __value);
305 /** \copydoc gridDeltaX */
306 double getGridDeltaX() const;
307 /** \copydoc gridDeltaY */
308 void setGridDeltaY(double __value);
309 /** \copydoc gridDeltaY */
310 double getGridDeltaY() const;
311 /** \copydoc gridSymbolFractionSize */
312 void setGridSymbolFractionSize(double __value);
313 /** \copydoc gridSymbolFractionSize */
315
316 /** \copydoc symbolFillDerivationMode */
318 /** \copydoc symbolFillDerivationMode */
320
321 /** \copydoc JKQTPGraph::setParent() */
322 virtual void setParent(JKQTBasePlotter* parent) override;
323
324
325 /** \copydoc JKQTPGraph::getOutsideSize() */
326 virtual void getOutsideSize(JKQTPEnhancedPainter& painter, int& leftSpace, int& rightSpace, int& topSpace, int& bottomSpace) override;
327
328 /** \copydoc JKQTPGraph::drawOutside() */
329 virtual void drawOutside(JKQTPEnhancedPainter& painter, QRect leftSpace, QRect rightSpace, QRect topSpace, QRect bottomSpace) override;
330
331
332 /** \brief determine min/max data value of the image */
333 virtual void cbGetDataMinMax(double& imin, double& imax) override;
334 /** \copydoc JKQTPGraph::usesColumn() */
335 virtual bool usesColumn(int c) const override;
336 /** \copydoc drawLine */
337 void setDrawLine(bool __value);
338 /** \copydoc drawLine */
339 bool getDrawLine() const;
340 /** \copydoc drawLineInForeground */
341 void setDrawLineInForeground(bool __value);
342 /** \copydoc drawLineInForeground */
344
345 /** \brief set color of line and symbol */
346 void setColor(QColor c);
347
348 protected:
349
350 /** \brief indicates whether to draw a line or not */
352 /** \brief indicates whether to draw the line behind or above the symbols */
354 /** \brief this column contains the symbol size in pt */
356 /** \brief this column contains the symbol color */
358 /** \brief this column contains the symbol type */
360 /** \brief this column contains the line width */
362
363 /** \brief if the gridModeForSymbolSize mode is actiavted (true), the plot assumes that the scatter symbols are ordered in a grid. It the uses the given griDeltaX and gridDeltaY to calculate the symbol size, so they fill the available space to a fraction gridSymbolFractionSize. */
365 /** \brief if the gridModeForSymbolSize mode is actiavted (true), the plot assumes that the scatter symbols are ordered in a grid. It the uses the given griDeltaX and gridDeltaY to calculate the symbol size, so they fill the available space to a fraction gridSymbolFractionSize. */
367 /** \brief if the gridModeForSymbolSize mode is actiavted (true), the plot assumes that the scatter symbols are ordered in a grid. It the uses the given griDeltaX and gridDeltaY to calculate the symbol size, so they fill the available space to a fraction gridSymbolFractionSize. */
369 /** \brief if the gridModeForSymbolSize mode is actiavted (true), the plot assumes that the scatter symbols are ordered in a grid. It the uses the given griDeltaX and gridDeltaY to calculate the symbol size, so they fill the available space to a fraction gridSymbolFractionSize. */
371
372 /** \brief if this is true, the value in the colorColumn is converted to an integer, representing a color in ARGB format (as in QRgb) */
374
375 /** \brief retrns the local line width for the i-th datapoint */
376 double getLocalLineWidth(int i);
377 /** \brief retrns the local symbol size for the i-th datapoint */
378 double getLocalSymbolSize(int i);
379 /** \brief retrns the local color for the i-th datapoint */
380 QColor getLocalColor(int i) const;
381 /** \brief retrns the local symbol type for the i-th datapoint */
383
384
385 /** \brief internally used to store the range of the color column */
386 double intColMin;
387 /** \brief internally used to store the range of the color column */
388 double intColMax;
389
390 /** \brief specifies how to derive the symbol fill color from the symbol/line color */
392
393 /** \brief functor, which converts the value of the symbol column (at a location x,y) into a JKQTPGraphSymbols */
395 /** \brief functor, which converts the value of the line width column (at a location x,y) into a line width (in pt) */
397 /** \brief functor, which converts the value of the line size column (at a location x,y) into a symbol size (in pt) */
399
400 /** \brief helper class for setMappedSymbolColumnFunctor() */
402 QMap<double, JKQTPGraphSymbols> mapping;
404 MappedSymbolFunctor(const QMap<double, JKQTPGraphSymbols>& mapping_, JKQTPXYParametrizedScatterGraph *graph);
405 JKQTPGraphSymbols operator()(double x, double y, double symcolumn) const;
406 };
407
408 /** \brief helper struct, which describes a single symbol */
410 double x;
411 double y;
413 double size;
414 QColor color;
415 QColor fillColor;
416 };
417};
418
419
420
421
422/*! \brief This implements xy scatter plots (like JKQTPXYScatterGraph), but the color and size of the symbols may be taken from a column. with errorbars
423 \ingroup jkqtplotter_linesymbolgraphs_param
424
425 set the properties sizeColumn and/or colorColumn to change the size and/or color of the symbols according to the values in the column.
426
427 \image html screen_parmetrizedplots_datatable.png
428
429 \see JKQTPXYParametrizedScatterGraph, \ref JKQTPlotterParamScatter, jkqtpstatAddXErrorParametrizedScatterGraph(), jkqtpstatAddYErrorParametrizedScatterGraph()
430 */
432 Q_OBJECT
433 public:
436
437
438 /** \copydoc JKQTPPlotElement::getXMinMax() */
439 virtual bool getXMinMax(double& minx, double& maxx, double& smallestGreaterZero) override;
440 /** \copydoc JKQTPPlotElement::getYMinMax() */
441 virtual bool getYMinMax(double& miny, double& maxy, double& smallestGreaterZero) override;
442 /** \copydoc JKQTPGraph::usesColumn() */
443 virtual bool usesColumn(int c) const override;
444
445 protected:
446 /** \brief this function is used to plot error inidcators before plotting the graphs. */
447 virtual void drawErrorsBefore(JKQTPEnhancedPainter& painter) override;
448
449 /** \brief this function can be used to set the color of the error indicators automatically
450 *
451 * return \c true and the colors to use, if applicable, the default implementation returns false */
452 virtual bool intPlotXYErrorIndicatorsGetColor(JKQTPEnhancedPainter& painter, const JKQTBasePlotter* parent, const JKQTPGraph* parentGraph, int xColumn, int yColumn, int xErrorColumn, int yErrorColumn, JKQTPErrorPlotstyle xErrorStyle, JKQTPErrorPlotstyle yErrorStyle, int index, QColor& errorLineColor, QColor& errorFillColor) const override;
453
454};
455
456
457
458
459
460#endif // jkqtpscatter_H
base class for 2D plotter classes (used by the plotter widget JKQTPlotter)
Definition jkqtpbaseplotter.h:394
if a class is derived from this class, it may use color bars
Definition jkqtpimagetools.h:44
this virtual class is the base for any type of coordinate axis, to be drawn by JKQTBasePlotter.
Definition jkqtpcoordinateaxes.h:181
This class manages data columns (with entries of type double ), used by JKQTPlotter/JKQTBasePlotter t...
Definition jkqtpdatastorage.h:282
this class extends the QPainter
Definition jkqtpenhancedpainter.h:33
this virtual base class of the (data-column based) graphs, which are part of a JKQTPlotter plot and w...
Definition jkqtpgraphsbase.h:429
This Mix-In class provides setter/getter methods, storage and other facilities for the graph line sty...
Definition jkqtpgraphsbasestylingmixins.h:49
This Mix-In class provides setter/getter methods, storage and other facilities for the graph symbols ...
Definition jkqtpgraphsbasestylingmixins.h:379
This class is the base class for graphs that only display error indicators in x- and y-direction.
Definition jkqtpgraphsbaseerrors.h:349
This virtual JKQTPGraph descendent may be used as base for all graphs that use at least two columns t...
Definition jkqtpgraphsbase.h:586
This implements xy scatter plots (like JKQTPXYScatterGraph), but the color and size of the symbols ma...
Definition jkqtpscatter.h:431
virtual bool intPlotXYErrorIndicatorsGetColor(JKQTPEnhancedPainter &painter, const JKQTBasePlotter *parent, const JKQTPGraph *parentGraph, int xColumn, int yColumn, int xErrorColumn, int yErrorColumn, JKQTPErrorPlotstyle xErrorStyle, JKQTPErrorPlotstyle yErrorStyle, int index, QColor &errorLineColor, QColor &errorFillColor) const override
this function can be used to set the color of the error indicators automatically
JKQTPXYParametrizedErrorScatterGraph(JKQTPlotter *parent)
virtual bool getYMinMax(double &miny, double &maxy, double &smallestGreaterZero) override
get the maximum and minimum y-value of the graph
JKQTPXYParametrizedErrorScatterGraph(JKQTBasePlotter *parent=nullptr)
virtual bool getXMinMax(double &minx, double &maxx, double &smallestGreaterZero) override
get the maximum and minimum x-value of the graph
virtual void drawErrorsBefore(JKQTPEnhancedPainter &painter) override
this function is used to plot error inidcators before plotting the graphs.
virtual bool usesColumn(int c) const override
returns true if the given column is used by the graph
This implements xy scatter plots (like JKQTPXYScatterGraph), but the color and size of the symbols ma...
Definition jkqtpscatter.h:147
int sizeColumn
this column contains the symbol size in pt
Definition jkqtpscatter.h:355
bool drawLine
indicates whether to draw a line or not
Definition jkqtpscatter.h:351
virtual void getOutsideSize(JKQTPEnhancedPainter &painter, int &leftSpace, int &rightSpace, int &topSpace, int &bottomSpace) override
if the graph plots outside the actual plot field of view (e.g. color bars, scale bars,...
std::function< JKQTPGraphSymbols(double x, double y, double symcolumn)> FunctorToSymbol
functor, which converts the value of the symbol column (at a location x,y) into a JKQTPGraphSymbols
Definition jkqtpscatter.h:151
double gridSymbolFractionSize
if the gridModeForSymbolSize mode is actiavted (true), the plot assumes that the scatter symbols are ...
Definition jkqtpscatter.h:370
bool getDrawLine() const
indicates whether to draw a line or not
int symbolColumn
this column contains the symbol type
Definition jkqtpscatter.h:359
virtual QColor getKeyLabelColor() const override
returns the color to be used for the key label
void setSizeColumn(size_t __value)
this column contains the symbol size in pt
JKQTPColorDerivationMode symbolFillDerivationMode
specifies how to derive the symbol fill color from the symbol/line color
Definition jkqtpscatter.h:391
virtual void setParent(JKQTBasePlotter *parent) override
sets the parent painter class
double getGridDeltaY() const
if the gridModeForSymbolSize mode is actiavted (true), the plot assumes that the scatter symbols are ...
void setDrawLine(bool __value)
indicates whether to draw a line or not
virtual void drawKeyMarker(JKQTPEnhancedPainter &painter, const QRectF &rect) override
plots a key marker inside the specified rectangle rect
virtual void drawOutside(JKQTPEnhancedPainter &painter, QRect leftSpace, QRect rightSpace, QRect topSpace, QRect bottomSpace) override
plots outside the actual plot field of view (e.g. color bars, scale bars, ...)
virtual void cbGetDataMinMax(double &imin, double &imax) override
determine min/max data value of the image
void setLinewidthColumn(int __value)
this column contains the line width
void setDrawLineInForeground(bool __value)
indicates whether to draw the line behind or above the symbols
double getGridSymbolFractionSize() const
if the gridModeForSymbolSize mode is actiavted (true), the plot assumes that the scatter symbols are ...
double gridDeltaX
if the gridModeForSymbolSize mode is actiavted (true), the plot assumes that the scatter symbols are ...
Definition jkqtpscatter.h:366
FunctorToSize getSizeColumnFunctor()
returns the current functor, which converts a value from the sizeColumn into an actual symbol size in...
int getSizeColumn() const
this column contains the symbol size in pt
JKQTPColorDerivationMode getSymbolFillDerivationMode() const
specifies how to derive the symbol fill color from the symbol/line color
void setGridDeltaX(double __value)
if the gridModeForSymbolSize mode is actiavted (true), the plot assumes that the scatter symbols are ...
void setSymbolColumn(int __value)
this column contains the symbol type
QColor getLocalColor(int i) const
retrns the local color for the i-th datapoint
int linewidthColumn
this column contains the line width
Definition jkqtpscatter.h:361
void setSizeColumnFunctor(FunctorToSize ff)
defines a functor, which converts a value from the sizeColumn into an actual symbol size in pt
int colorColumn
this column contains the symbol color
Definition jkqtpscatter.h:357
double getLocalLineWidth(int i)
retrns the local line width for the i-th datapoint
void setColorColumnContainsRGB(bool __value)
if this is true, the value in the colorColumn is converted to an integer, representing a color in ARG...
void setGridModeForSymbolSize(bool __value)
if the gridModeForSymbolSize mode is actiavted (true), the plot assumes that the scatter symbols are ...
void setColor(QColor c)
set color of line and symbol
virtual void draw(JKQTPEnhancedPainter &painter) override
plots the graph to the plotter object specified as parent
double intColMax
internally used to store the range of the color column
Definition jkqtpscatter.h:388
FunctorToSize m_toSizePtFunctor
functor, which converts the value of the line size column (at a location x,y) into a symbol size (in ...
Definition jkqtpscatter.h:398
JKQTPGraphSymbols getLocalSymbolType(int i)
retrns the local symbol type for the i-th datapoint
void setColorColumn(size_t __value)
this column contains the symbol color
bool getColorColumnContainsRGB() const
if this is true, the value in the colorColumn is converted to an integer, representing a color in ARG...
std::function< double(double x, double y, double sizecolumn)> FunctorToSize
functor, which converts the value of the line size column (at a location x,y) into a symbol size (in ...
Definition jkqtpscatter.h:155
double gridDeltaY
if the gridModeForSymbolSize mode is actiavted (true), the plot assumes that the scatter symbols are ...
Definition jkqtpscatter.h:368
void setLinewidthColumn(size_t __value)
this column contains the line width
int getColorColumn() const
this column contains the symbol color
FunctorToSymbol getSymbolColumnFunctor()
returns the current functor, which converts a value from the symbolColumn into an actual symbol type
JKQTPXYParametrizedScatterGraph(JKQTPlotter *parent)
class constructor
bool gridModeForSymbolSize
if the gridModeForSymbolSize mode is actiavted (true), the plot assumes that the scatter symbols are ...
Definition jkqtpscatter.h:364
bool colorColumnContainsRGB
if this is true, the value in the colorColumn is converted to an integer, representing a color in ARG...
Definition jkqtpscatter.h:373
void setSymbolColumnFunctor(FunctorToSymbol ff)
defines a functor, which converts a value from the symbolColumn into an actual symbol type
bool getGridModeForSymbolSize() const
if the gridModeForSymbolSize mode is actiavted (true), the plot assumes that the scatter symbols are ...
double getLocalSymbolSize(int i)
retrns the local symbol size for the i-th datapoint
JKQTPXYParametrizedScatterGraph(JKQTBasePlotter *parent=nullptr)
class constructor
void setSymbolFillDerivationMode(JKQTPColorDerivationMode m)
specifies how to derive the symbol fill color from the symbol/line color
void setGridSymbolFractionSize(double __value)
if the gridModeForSymbolSize mode is actiavted (true), the plot assumes that the scatter symbols are ...
virtual bool usesColumn(int c) const override
returns true if the given column is used by the graph
FunctorToWidth m_toWidthPtFunctor
functor, which converts the value of the line width column (at a location x,y) into a line width (in ...
Definition jkqtpscatter.h:396
void setGridDeltaY(double __value)
if the gridModeForSymbolSize mode is actiavted (true), the plot assumes that the scatter symbols are ...
double getGridDeltaX() const
if the gridModeForSymbolSize mode is actiavted (true), the plot assumes that the scatter symbols are ...
void setSizeColumn(int __value)
this column contains the symbol size in pt
FunctorToSymbol m_toSymbolFunctor
functor, which converts the value of the symbol column (at a location x,y) into a JKQTPGraphSymbols
Definition jkqtpscatter.h:394
void clearSizeColumnFunctor()
defines a standard (1:1) functor, which converts a value from the sizeColumn into an actual symbol si...
void setSymbolColumn(size_t __value)
this column contains the symbol type
double intColMin
internally used to store the range of the color column
Definition jkqtpscatter.h:386
int getSymbolColumn() const
this column contains the symbol type
void clearLinewidthColumnFunctor()
defines a standard (1:1) functor, which converts a value from the symbolColumn into an actual line wi...
bool getDrawLineInForeground() const
indicates whether to draw the line behind or above the symbols
std::function< double(double x, double y, double widcolumn)> FunctorToWidth
functor, which converts the value of the line width column (at a location x,y) into a line width (in ...
Definition jkqtpscatter.h:153
FunctorToWidth getLinewidthColumnFunctor()
returns the current functor, which converts a value from the symbolColumn into an actual line width i...
void setMappedSymbolColumnFunctor(const QMap< double, JKQTPGraphSymbols > &symmap)
defines a special functor, which converts a value from the symbolColumn into an actual symbol type,...
void clearSymbolColumnFunctor()
defines a standard (1:1) functor, which converts a value from the symbolColumn into an actual symbol ...
void setColorColumn(int __value)
this column contains the symbol color
void setLinewidthColumnFunctor(FunctorToWidth ff)
defines a functor, which converts a value from the symbolColumn into an actual line width in pt
int getLinewidthColumn() const
this column contains the line width
bool drawLineInForeground
indicates whether to draw the line behind or above the symbols
Definition jkqtpscatter.h:353
This implements xy scatter plots with x and y error indicators.
Definition jkqtpscatter.h:96
JKQTPXYScatterErrorGraph(JKQTBasePlotter *parent=nullptr)
class constructor
virtual void drawErrorsBefore(JKQTPEnhancedPainter &painter) override
this function is used to plot error inidcators before plotting the graphs.
virtual bool usesColumn(int c) const override
returns true if the given column is used by the graph
virtual bool getXMinMax(double &minx, double &maxx, double &smallestGreaterZero) override
get the maximum and minimum x-value of the graph
virtual bool getYMinMax(double &miny, double &maxy, double &smallestGreaterZero) override
get the maximum and minimum y-value of the graph
JKQTPXYScatterErrorGraph(JKQTPlotter *parent)
class constructor
This implements xy scatter plots. This also alows to draw symbols at the data points.
Definition jkqtpscatter.h:59
void setColor(QColor c)
set color of line and symbol
JKQTPXYScatterGraph(JKQTBasePlotter *parent=nullptr)
class constructor
virtual void draw(JKQTPEnhancedPainter &painter) override
plots the graph to the plotter object specified as parent
virtual void drawKeyMarker(JKQTPEnhancedPainter &painter, const QRectF &rect) override
plots a key marker inside the specified rectangle rect
virtual QColor getKeyLabelColor() const override
returns the color to be used for the key label
JKQTPXYScatterGraph(JKQTPlotter *parent)
class constructor
plotter widget for scientific plots (uses JKQTBasePlotter to do the actual drawing)
Definition jkqtplotter.h:364
QFlags< JKQTPErrorPlotstyleElements > JKQTPErrorPlotstyle
specifies the plot styles for the error information, e.g. error bars, boxes, lines ....
Definition jkqtptools.h:728
JKQTPGraphSymbols type
Definition jkqtpscatter.h:412
QColor fillColor
Definition jkqtpscatter.h:415
QColor color
Definition jkqtpscatter.h:414
double size
Definition jkqtpscatter.h:413
double x
Definition jkqtpscatter.h:410
double y
Definition jkqtpscatter.h:411
helper struct, which describes a single symbol
Definition jkqtpscatter.h:409
#define JKQTPLOTTER_LIB_EXPORT
Definition jkqtplotter_imexport.h:89
JKQTPGraphSymbols
symbols that can be used to plot a datapoint for a graph
Definition jkqtpdrawingtools.h:143
Specifies how a fill-color is derived from a given color.
Definition jkqtptools.h:262
helper class for setMappedSymbolColumnFunctor()
Definition jkqtpscatter.h:401
JKQTPGraphSymbols operator()(double x, double y, double symcolumn) const
JKQTPXYParametrizedScatterGraph * parent
Definition jkqtpscatter.h:403
MappedSymbolFunctor(const QMap< double, JKQTPGraphSymbols > &mapping_, JKQTPXYParametrizedScatterGraph *graph)
QMap< double, JKQTPGraphSymbols > mapping
Definition jkqtpscatter.h:402