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
jkqtpviolinplotstylingmixins.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 jkqtpgraphsviolinplotstylingmixins_H
21#define jkqtpgraphsviolinplotstylingmixins_H
22
23
24
25#include <QString>
26#include <QPainter>
27#include "jkqtplotter/jkqtptools.h"
28#include "jkqtplotter/jkqtplotter_imexport.h"
29#include "jkqtplotter/jkqtplotter_configmacros.h"
30#include "jkqtplotter/jkqtpgraphsbase.h"
31#include "jkqtplotter/jkqtpgraphsbasestylingmixins.h"
32
33
34
35
36/*! \brief Styling Mix-In for Violinplots
37 \ingroup jkqtplotter_specialgraphs_stylemixins
38
39
40 \image html JKQTPViolinplotHorizontalElement_elements.png
41
42 */
44#ifndef JKQTPLOTTER_WORKAROUND_QGADGET_BUG
45 Q_GADGET
46#endif
47 public:
48
49
50 /** \brief class constructor */
52
53 void initViolinplotStyle(JKQTBasePlotter* parent, int &parentPlotStyle);
54 /** \copydoc violinWidthAbsolute */
55 void setViolinWidthAbsolute(double __value);
56 /** \copydoc violinWidthAbsolute */
57 double getViolinWidthAbsolute() const;
58
59 /** \copydoc relativeWhiskerWidth */
60 void setRelativeWhiskerWidth(double __value);
61 /** \copydoc relativeWhiskerWidth */
63
64
65 /** \brief set the line style of whisker lines */
66 void setWhiskerLineStyle(Qt::PenStyle __value);
67 /** \brief get the line style of whisker lines */
68 Qt::PenStyle getWhiskerLineStyle() const;
69
70 /** \brief set the width [pt] of whisker lines */
71 void setWhiskerLineWidth(double __value);
72 /** \brief get the width [pt] of whisker lines */
73 double getWhiskerLineWidth() const;
74
75 /** \brief set the color of whisker lines */
76 void setWhiskerLineColor(QColor __value);
77 /** \brief get the color of whisker lines */
78 QColor getWhiskerLineColor() const;
79
80
81 /** \brief sets the dash offset for a custom dash style of whisker lines
82 * \see https://doc.qt.io/qt-5/qpen.html#setDashOffset
83 */
84 void setWhiskerLineDashOffset(qreal offset);
85 /** \brief returns the dash offset for a custom dash style of whisker lines
86 * \see https://doc.qt.io/qt-5/qpen.html#setDashOffset
87 */
89 /** \brief sets the dash pattern for a custom dash style of whisker lines
90 * \see https://doc.qt.io/qt-5/qpen.html#setDashPattern
91 */
92 void setWhiskerLineDashPattern(const QVector<qreal> &pattern);
93 /** \brief gets the dash pattern for a custom dash style of whisker lines
94 * \see https://doc.qt.io/qt-5/qpen.html#setDashPattern
95 */
96 QVector<qreal> getWhiskerLineDashPattern() const;
97 /** \brief sets the join style of whisker lines
98 * \see https://doc.qt.io/qt-5/qpen.html#setJoinStyle
99 */
100 void setWhiskerLineJoinStyle(Qt::PenJoinStyle style);
101 /** \brief returns the join style of whisker lines
102 * \see https://doc.qt.io/qt-5/qpen.html#setJoinStyle
103 */
104 Qt::PenJoinStyle getWhiskerLineJoinStyle() const;
105 /** \brief sets the cap style of whisker lines
106 * \see https://doc.qt.io/qt-5/qpen.html#setCapStyle
107 */
108 void setWhiskerLineCapStyle(Qt::PenCapStyle style);
109 /** \brief gets the cap style of whisker lines
110 * \see https://doc.qt.io/qt-5/qpen.html#setCapStyle
111 */
112 Qt::PenCapStyle getWhiskerLineCapStyle() const;
113 /** \brief sets the brush used to fill the line area of whisker lines
114 * \see https://doc.qt.io/qt-5/qpen.html#setBrush
115 */
116 void setWhiskerLineBrush(const QBrush& style);
117 /** \brief gets the brush used to fill the line area of whisker lines
118 * \see https://doc.qt.io/qt-5/qpen.html#setBrush
119 */
120 QBrush getWhiskerLineBrush() const;
121
122 /** \brief build a pen to be used for drawing whiskers */
124
125
126
127 /** \brief set the line style of whisker cap lines */
128 void setWhiskerCapLineStyle(Qt::PenStyle __value);
129 /** \brief get the line style of whisker cap lines */
130 Qt::PenStyle getWhiskerCapLineStyle() const;
131
132 /** \brief set the width [pt] of whisker cap lines */
133 void setWhiskerCapLineWidth(double __value);
134 /** \brief get the width [pt] of whisker cap lines */
136
137 /** \brief set the color of whisker cap lines */
138 void setWhiskerCapLineColor(QColor __value);
139 /** \brief get the color of whisker cap lines */
141
142
143 /** \brief sets the dash offset for a custom dash style of whisker cap lines
144 * \see https://doc.qt.io/qt-5/qpen.html#setDashOffset
145 */
146 void setWhiskerCapLineDashOffset(qreal offset);
147 /** \brief returns the dash offset for a custom dash style of whisker cap lines
148 * \see https://doc.qt.io/qt-5/qpen.html#setDashOffset
149 */
151 /** \brief sets the dash pattern for a custom dash style of whisker cap lines
152 * \see https://doc.qt.io/qt-5/qpen.html#setDashPattern
153 */
154 void setWhiskerCapLineDashPattern(const QVector<qreal> &pattern);
155 /** \brief gets the dash pattern for a custom dash style of whisker cap lines
156 * \see https://doc.qt.io/qt-5/qpen.html#setDashPattern
157 */
158 QVector<qreal> getWhiskerCapLineDashPattern() const;
159 /** \brief sets the join style of whisker cap lines
160 * \see https://doc.qt.io/qt-5/qpen.html#setJoinStyle
161 */
162 void setWhiskerCapLineJoinStyle(Qt::PenJoinStyle style);
163 /** \brief returns the join style of whisker cap lines
164 * \see https://doc.qt.io/qt-5/qpen.html#setJoinStyle
165 */
166 Qt::PenJoinStyle getWhiskerCapLineJoinStyle() const;
167 /** \brief sets the cap style of whisker cap lines
168 * \see https://doc.qt.io/qt-5/qpen.html#setCapStyle
169 */
170 void setWhiskerCapLineCapStyle(Qt::PenCapStyle style);
171 /** \brief gets the cap style of whisker cap lines
172 * \see https://doc.qt.io/qt-5/qpen.html#setCapStyle
173 */
174 Qt::PenCapStyle getWhiskerCapLineCapStyle() const;
175 /** \brief sets the brush used to fill the line area of whisker cap lines
176 * \see https://doc.qt.io/qt-5/qpen.html#setBrush
177 */
178 void setWhiskerCapLineBrush(const QBrush& style);
179 /** \brief gets the brush used to fill the line area of whisker cap lines
180 * \see https://doc.qt.io/qt-5/qpen.html#setBrush
181 */
183
184 /** \brief build a pen to be used for drawing whisker caps */
186
187
188
189 /** \brief set the line style of median lines */
190 void setMedianLineStyle(Qt::PenStyle __value);
191 /** \brief get the line style of median lines */
192 Qt::PenStyle getMedianLineStyle() const;
193
194 /** \brief set the width [pt] of median lines */
195 void setMedianLineWidth(double __value);
196 /** \brief get the width [pt] of median lines */
197 double getMedianLineWidth() const;
198
199 /** \brief set the color of median lines */
200 void setMedianLineColor(QColor __value);
201 /** \brief get the color of median lines */
202 QColor getMedianLineColor() const;
203
204
205 /** \brief sets the dash offset for a custom dash style of median lines
206 * \see https://doc.qt.io/qt-5/qpen.html#setDashOffset
207 */
208 void setMedianLineDashOffset(qreal offset);
209 /** \brief returns the dash offset for a custom dash style of median lines
210 * \see https://doc.qt.io/qt-5/qpen.html#setDashOffset
211 */
213 /** \brief sets the dash pattern for a custom dash style of median lines
214 * \see https://doc.qt.io/qt-5/qpen.html#setDashPattern
215 */
216 void setMedianLineDashPattern(const QVector<qreal> &pattern);
217 /** \brief gets the dash pattern for a custom dash style of median lines
218 * \see https://doc.qt.io/qt-5/qpen.html#setDashPattern
219 */
220 QVector<qreal> getMedianLineDashPattern() const;
221 /** \brief sets the join style of median lines
222 * \see https://doc.qt.io/qt-5/qpen.html#setJoinStyle
223 */
224 void setMedianLineJoinStyle(Qt::PenJoinStyle style);
225 /** \brief returns the join style of median lines
226 * \see https://doc.qt.io/qt-5/qpen.html#setJoinStyle
227 */
228 Qt::PenJoinStyle getMedianLineJoinStyle() const;
229 /** \brief sets the cap style of median lines
230 * \see https://doc.qt.io/qt-5/qpen.html#setCapStyle
231 */
232 void setMedianLineCapStyle(Qt::PenCapStyle style);
233 /** \brief gets the cap style of median lines
234 * \see https://doc.qt.io/qt-5/qpen.html#setCapStyle
235 */
236 Qt::PenCapStyle getMedianLineCapStyle() const;
237 /** \brief sets the brush used to fill the line area of median lines
238 * \see https://doc.qt.io/qt-5/qpen.html#setBrush
239 */
240 void setMedianLineBrush(const QBrush& style);
241 /** \brief gets the brush used to fill the line area of median lines
242 * \see https://doc.qt.io/qt-5/qpen.html#setBrush
243 */
244 QBrush getMedianLineBrush() const;
245
246 /** \brief build a pen to be used for drawing medians */
247 QPen getMedianPen(JKQTPEnhancedPainter &painter, JKQTBasePlotter *parent) const;
248
249
250
251
252
253 /** \brief set the line style of Mean lines */
254 void setMeanLineStyle(Qt::PenStyle __value);
255 /** \brief get the line style of Mean lines */
256 Qt::PenStyle getMeanLineStyle() const;
257 /** \brief sets the dash offset for a custom dash style of Mean lines
258 * \see https://doc.qt.io/qt-5/qpen.html#setDashOffset
259 */
260 void setMeanLineDashOffset(qreal offset);
261 /** \brief returns the dash offset for a custom dash style of Mean lines
262 * \see https://doc.qt.io/qt-5/qpen.html#setDashOffset
263 */
265 /** \brief sets the dash pattern for a custom dash style of Mean lines
266 * \see https://doc.qt.io/qt-5/qpen.html#setDashPattern
267 */
268 void setMeanLineDashPattern(const QVector<qreal> &pattern);
269 /** \brief gets the dash pattern for a custom dash style of Mean lines
270 * \see https://doc.qt.io/qt-5/qpen.html#setDashPattern
271 */
272 QVector<qreal> getMeanLineDashPattern() const;
273 /** \brief set the type of the symbol for the mean */
275 /** \brief get the type of the symbol for the mean */
277 /** \brief set the font to be used for mean character symbols \c JKQTPCharacterSymbol+QChar('').unicode() */
278 void setMeanSymbolFontName(const QString& __value);
279 /** \brief get the font to be used for mean character symbols \c JKQTPCharacterSymbol+QChar('').unicode() */
280 QString getMeanSymbolFontName() const;
281
282 /** \brief set the size (=diameter in pt) of the symbol for the mean (in pt) */
283 void setMeanSize(double __value);
284 /** \brief get the size (=diameter in pt) of the symbol for the mean (in pt) */
285 double getMeanSize() const;
286
287 /** \brief set the color of the symbol for the mean, or mean line */
288 void setMeanColor(const QColor & __value);
289 /** \brief set the color of the symbol for the mean, or mean line */
290 QColor getMeanColor() const;
291
292 /** \brief set the color of filling of the symbol for the mean */
293 void setMeanFillColor(const QColor & __value);
294 /** \brief set the color of filling of the symbol for the mean */
295 QColor getMeanFillColor() const;
296
297 /** \brief set the line width of the symbol for the mean outline, or mean line (in pt) */
298 void setMeanLineWidth(double __value);
299 /** \brief get the line width of the symbol for the mean outline, or mean line (in pt) */
300 double getMeanLineWidth() const;
301
302 /** \brief defines how to draw the violin graph */
304 SmoothViolin, /*!< \brief connect all violin points by lines, resulting in a (nearly) smooth curve \image html JKQTPGraphViolinplot_SmoothViolin.png */
305 StepViolin, /*!< \brief connect violin points by a steped line, but fully filled \image html JKQTPGraphViolinplot_StepViolin.png */
306 BoxViolin, /*!< \brief violin datapoints are drawn like a boxplot \image html JKQTPGraphViolinplot_BoxViolin.png */
307 };
308
309 /** \brief returns the style of the violin plot */
311 /** \brief set the style of the violin plot */
313
314 /** \brief defines where to draw the violin graph with respect to the violin center position */
316 ViolinLeft, /*!< \brief draw violin on the left hand side only (for vertical violins) \image html JKQTPGraphViolinplot_ViolinLeft.png */
317 ViolinBottom=ViolinLeft, /*!< \brief draw violin on the bottom side only (for horizontal violins) \image html JKQTPGraphViolinplot_ViolinBottom.png */
318 ViolinRight, /*!< \brief draw violin on the right hand side only (for vertical violins) \image html JKQTPGraphViolinplot_ViolinRight.png */
319 ViolinTop=ViolinRight, /*!< \brief draw violin on the top side only (for horizontal violins) \image html JKQTPGraphViolinplot_ViolinTop.png */
320 ViolinBoth /*!< \brief draw violin on the left+right or top+bottom side
321 \image html JKQTPGraphViolinplot_ViolinBoth.png
322 \image html JKQTPGraphViolinplot_ViolinHBoth.png */
323 };
324
325 /** \brief returns the position mode of the violin plot */
327 /** \brief set the position mode of the violin plot */
329
330
331 /** \brief constructs a QPen from the line styling properties to draw the mean line */
333 /** \brief constructs a QPen from the line styling properties to draw the mean symbol */
335 /** \brief constructs a QPen from the line styling properties */
337
338 /** \brief set the color of the graph (colors all elements, based on the given color \a c ) */
339 void setViolinplotColor(QColor c, JKQTBasePlotter *parent);
340
341 /** \brief set the color of the graph (colors all elements, based on the given color \a c , sets background colors from \a bc ) */
342 void setViolinplotColor(QColor c, QColor bc, JKQTBasePlotter *parent);
343 /** \brief generate a QFont for darwing symbols */
344 QFont getMeanSymbolFont() const;
345 protected:
346 /*! \brief plot a symbol at location x,y (in painter coordinates), using the current style
347
348 \param parent parent JKQTBasePlotter of the graph that uses this mix-in (used e.g. for line-width transformation)
349 \param painter the <a href="http://doc.qt.io/qt-5/qpainter.html">QPainter</a> to draw to
350 \param x x-coordinate of the symbol center
351 \param y y-coordinate of the symbol center
352 */
353 void plotStyledMeanSymbol(JKQTBasePlotter* parent, JKQTPEnhancedPainter &painter, double x, double y) const;
354 /** \brief draws a vertical boxplot, with all coordinates/sizes given in coordinates of the given painter,
355 * using the style properties declared in this class. Provide a parameter with \c JKQTP_NAN of you
356 * don't want it to be drawn, or don't know its value
357 *
358 * \param parent parent JKQTBasePlotter of the graph that uses this mix-in (used e.g. for line-width transformation)
359 * \param painter the <a href="http://doc.qt.io/qt-5/qpainter.html">QPainter</a> to draw to
360 * \param xp x-coordinate of the boxplot center
361 * \param xpleft x-coordinate of the boxplot box left edge
362 * \param xpright x-coordinate of the boxplot box right edge
363 * \param violin_cat category-dataset for the violin (y-values of KDE/histogram/...)
364 * \param violin_freq frequency/count-dataset for the violin (y-values/frequencies of KDE/histogram/...)
365 * \param minp y-coordinate of the minimum (lower whisker)
366 * \param medianp y-coordinate the median
367 * \param maxp y-coordinate of the maximum (upper whisker)
368 * \param meanp y-coordinate of the mean (symbol or line)
369 */
370 void plotVerticalViolinplot(JKQTBasePlotter* parent, JKQTPEnhancedPainter &painter, double xp, double xpleft, double xpright, const QVector<double> &violin_cat, const QVector<double>& violin_freq, double minp, double medianp, double maxp, double meanp=JKQTP_NAN) const;
371
372 /** \brief draws a horizontal boxplot, with all coordinates/sizes given in coordinates of the given painter,
373 * using the style properties declared in this class. Provide a parameter with \c JKQTP_NAN of you
374 * don't want it to be drawn, or don't know its value
375 *
376 * \param parent parent JKQTBasePlotter of the graph that uses this mix-in (used e.g. for line-width transformation)
377 * \param painter the <a href="http://doc.qt.io/qt-5/qpainter.html">QPainter</a> to draw to
378 * \param yp y-coordinate of the boxplot center
379 * \param ypbottom y-coordinate of the boxplot box bottom edge
380 * \param yptop y-coordinate of the boxplot box top edge
381 * \param violin_cat category-dataset for the violin (x-values of KDE/histogram/...)
382 * \param violin_freq frequency/count-dataset for the violin (y-values/frequencies of KDE/histogram/...)
383 * \param minp x-coordinate of the minimum (lower whisker)
384 * \param medianp x-coordinate the median
385 * \param maxp x-coordinate of the maximum (upper whisker)
386 * \param meanp x-coordinate of the mean (symbol or line)
387 */
388 void plotHorizontalViolinplot(JKQTBasePlotter* parent, JKQTPEnhancedPainter &painter, double yp, double ypbottom, double yptop, const QVector<double>& violin_cat, const QVector<double>& violin_freq, double minp, double medianp, double maxp, double meanp=JKQTP_NAN) const;
389
390 /** \brief draw a small, stylized, vertical symbol into \a rect that symbolizes a boxplot, e.g. in a plot legend */
391 void plotVerticalKeyMarker(JKQTBasePlotter* parent, JKQTPEnhancedPainter &painter, const QRectF& rect) const;
392
393 /** \brief draw a small, stylized, horizontal symbol into \a rect that symbolizes a boxplot, e.g. in a plot legend */
394 void plotHorizontalKeyMarker(JKQTBasePlotter* parent, JKQTPEnhancedPainter &painter, const QRectF& rect) const;
395 private:
396 /** \brief which symbol to use for the datapoints */
398 /** \brief size (diameter in pt) of the symbol for the data points, given in pt */
400 /** \brief outline color of the symbol or line pen of the mean-line */
402 /** \brief color of the symbol filling */
404 /** \brief width (in pt) of the lines used to plot the symbol for the data points, given in pt */
406 /** \brief font to be used for character mean symbols \c JKQTPCharacterSymbol+QChar('').unicode() */
408
409 /** \brief line style of the whisker lines */
411 /** \brief line width (in pt) of the whisker lines */
413 /** \brief line style of the whisker cap lines */
415 /** \brief line width (in pt) of the whisker cap lines */
417 /** \brief line style of the median lines */
419 /** \brief line width (in pt) of the median lines */
421 /** \brief width of box in pt.
422 *
423 * \note If several boxplots are drawn, the width is typically calculated,
424 * based on a relative width and the position distances, see JKQTPBoxplotVerticalGraph::boxWidthRelative */
426 /** \brief width of the whiskers, relative to the box width (default: 0.5) */
428
429 /** \brief the style of the violin plot */
431
432 /** \brief the position mode of the violin plot */
434
435};
436
437
438
439
440
441#endif // jkqtpgraphsviolinplotstylingmixins_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
This Mix-In class provides setter/getter methods, storage and other facilities for the graph filling ...
Definition jkqtpgraphsbasestylingmixins.h:529
This Mix-In class provides setter/getter methods, storage and other facilities for the graph line sty...
Definition jkqtpgraphsbasestylingmixins.h:49
Styling Mix-In for Violinplots.
Definition jkqtpviolinplotstylingmixins.h:43
JKQTPGraphSymbols m_meanSymbolType
which symbol to use for the datapoints
Definition jkqtpviolinplotstylingmixins.h:397
QPen getMedianPen(JKQTPEnhancedPainter &painter, JKQTBasePlotter *parent) const
build a pen to be used for drawing medians
void setWhiskerLineCapStyle(Qt::PenCapStyle style)
sets the cap style of whisker lines
QPen getMeanSymbolPen(JKQTPEnhancedPainter &painter, JKQTBasePlotter *parent) const
constructs a QPen from the line styling properties to draw the mean symbol
ViolinStyle
defines how to draw the violin graph
Definition jkqtpviolinplotstylingmixins.h:303
@ StepViolin
connect violin points by a steped line, but fully filled
Definition jkqtpviolinplotstylingmixins.h:305
@ SmoothViolin
connect all violin points by lines, resulting in a (nearly) smooth curve
Definition jkqtpviolinplotstylingmixins.h:304
@ BoxViolin
violin datapoints are drawn like a boxplot
Definition jkqtpviolinplotstylingmixins.h:306
double getMeanLineWidth() const
get the line width of the symbol for the mean outline, or mean line (in pt)
double whiskerLineWidth
line width (in pt) of the whisker lines
Definition jkqtpviolinplotstylingmixins.h:412
QBrush getMeanSymbolBrush(JKQTPEnhancedPainter &painter, JKQTBasePlotter *parent) const
constructs a QPen from the line styling properties
double relativeWhiskerWidth
width of the whiskers, relative to the box width (default: 0.5)
Definition jkqtpviolinplotstylingmixins.h:427
void setWhiskerLineWidth(double __value)
set the width [pt] of whisker lines
void setMeanLineDashOffset(qreal offset)
sets the dash offset for a custom dash style of Mean lines
QVector< qreal > getWhiskerCapLineDashPattern() const
gets the dash pattern for a custom dash style of whisker cap lines
ViolinPositionMode m_violinPositionMode
the position mode of the violin plot
Definition jkqtpviolinplotstylingmixins.h:433
void setWhiskerCapLineJoinStyle(Qt::PenJoinStyle style)
sets the join style of whisker cap lines
QPen getMeanLinePen(JKQTPEnhancedPainter &painter, JKQTBasePlotter *parent) const
constructs a QPen from the line styling properties to draw the mean line
void setViolinplotColor(QColor c, JKQTBasePlotter *parent)
set the color of the graph (colors all elements, based on the given color c )
QPen m_medianLinePen
line style of the median lines
Definition jkqtpviolinplotstylingmixins.h:418
void setWhiskerCapLineStyle(Qt::PenStyle __value)
set the line style of whisker cap lines
QPen getWhiskerCapPen(JKQTPEnhancedPainter &painter, JKQTBasePlotter *parent) const
build a pen to be used for drawing whisker caps
void setViolinStyle(ViolinStyle style)
set the style of the violin plot
QColor getMeanColor() const
set the color of the symbol for the mean, or mean line
JKQTPGraphViolinplotStyleMixin()
class constructor
QColor m_meanSymbolFillColor
color of the symbol filling
Definition jkqtpviolinplotstylingmixins.h:403
QColor getMedianLineColor() const
get the color of median lines
void setMeanSymbolFontName(const QString &__value)
set the font to be used for mean character symbols JKQTPCharacterSymbol+QChar('')....
void setViolinWidthAbsolute(double __value)
width of box in pt.
void setMeanColor(const QColor &__value)
set the color of the symbol for the mean, or mean line
void setMeanLineDashPattern(const QVector< qreal > &pattern)
sets the dash pattern for a custom dash style of Mean lines
QFont getMeanSymbolFont() const
generate a QFont for darwing symbols
QPen m_whiskerLinePen
line style of the whisker lines
Definition jkqtpviolinplotstylingmixins.h:410
void plotVerticalViolinplot(JKQTBasePlotter *parent, JKQTPEnhancedPainter &painter, double xp, double xpleft, double xpright, const QVector< double > &violin_cat, const QVector< double > &violin_freq, double minp, double medianp, double maxp, double meanp=JKQTP_NAN) const
draws a vertical boxplot, with all coordinates/sizes given in coordinates of the given painter,...
QColor getWhiskerLineColor() const
get the color of whisker lines
qreal getMedianLineDashOffset() const
returns the dash offset for a custom dash style of median lines
void setMedianLineColor(QColor __value)
set the color of median lines
void setMeanFillColor(const QColor &__value)
set the color of filling of the symbol for the mean
double getMedianLineWidth() const
get the width [pt] of median lines
QBrush getWhiskerLineBrush() const
gets the brush used to fill the line area of whisker lines
void setMedianLineDashOffset(qreal offset)
sets the dash offset for a custom dash style of median lines
QBrush getWhiskerCapLineBrush() const
gets the brush used to fill the line area of whisker cap lines
void setWhiskerLineColor(QColor __value)
set the color of whisker lines
qreal getWhiskerCapLineDashOffset() const
returns the dash offset for a custom dash style of whisker cap lines
void plotHorizontalKeyMarker(JKQTBasePlotter *parent, JKQTPEnhancedPainter &painter, const QRectF &rect) const
draw a small, stylized, horizontal symbol into rect that symbolizes a boxplot, e.g....
ViolinPositionMode
defines where to draw the violin graph with respect to the violin center position
Definition jkqtpviolinplotstylingmixins.h:315
@ ViolinRight
draw violin on the right hand side only (for vertical violins)
Definition jkqtpviolinplotstylingmixins.h:318
@ ViolinLeft
draw violin on the left hand side only (for vertical violins)
Definition jkqtpviolinplotstylingmixins.h:316
double getMeanSize() const
get the size (=diameter in pt) of the symbol for the mean (in pt)
QVector< qreal > getMedianLineDashPattern() const
gets the dash pattern for a custom dash style of median lines
void setMeanSymbolType(JKQTPGraphSymbols __value)
set the type of the symbol for the mean
QVector< qreal > getWhiskerLineDashPattern() const
gets the dash pattern for a custom dash style of whisker lines
void setWhiskerCapLineWidth(double __value)
set the width [pt] of whisker cap lines
QPen m_meanSymbolLinePen
outline color of the symbol or line pen of the mean-line
Definition jkqtpviolinplotstylingmixins.h:401
ViolinStyle getViolinStyle() const
returns the style of the violin plot
void setWhiskerCapLineDashOffset(qreal offset)
sets the dash offset for a custom dash style of whisker cap lines
void setMedianLineStyle(Qt::PenStyle __value)
set the line style of median lines
double m_meanSymbolLineWidth
width (in pt) of the lines used to plot the symbol for the data points, given in pt
Definition jkqtpviolinplotstylingmixins.h:405
double getRelativeWhiskerWidth() const
width of the whiskers, relative to the box width (default: 0.5)
QColor getWhiskerCapLineColor() const
get the color of whisker cap lines
void setWhiskerLineDashOffset(qreal offset)
sets the dash offset for a custom dash style of whisker lines
double getViolinWidthAbsolute() const
width of box in pt.
QBrush getMedianLineBrush() const
gets the brush used to fill the line area of median lines
void plotVerticalKeyMarker(JKQTBasePlotter *parent, JKQTPEnhancedPainter &painter, const QRectF &rect) const
draw a small, stylized, vertical symbol into rect that symbolizes a boxplot, e.g. in a plot legend
double whiskerCapLineWidth
line width (in pt) of the whisker cap lines
Definition jkqtpviolinplotstylingmixins.h:416
void setWhiskerLineDashPattern(const QVector< qreal > &pattern)
sets the dash pattern for a custom dash style of whisker lines
Qt::PenJoinStyle getMedianLineJoinStyle() const
returns the join style of median lines
double getWhiskerCapLineWidth() const
get the width [pt] of whisker cap lines
Qt::PenJoinStyle getWhiskerLineJoinStyle() const
returns the join style of whisker lines
Qt::PenJoinStyle getWhiskerCapLineJoinStyle() const
returns the join style of whisker cap lines
QColor getMeanFillColor() const
set the color of filling of the symbol for the mean
void setMeanLineWidth(double __value)
set the line width of the symbol for the mean outline, or mean line (in pt)
qreal getMeanLineDashOffset() const
returns the dash offset for a custom dash style of Mean lines
void setMedianLineCapStyle(Qt::PenCapStyle style)
sets the cap style of median lines
void setWhiskerLineBrush(const QBrush &style)
sets the brush used to fill the line area of whisker lines
double getWhiskerLineWidth() const
get the width [pt] of whisker lines
Qt::PenStyle getWhiskerLineStyle() const
get the line style of whisker lines
Qt::PenStyle getMedianLineStyle() const
get the line style of median lines
void setWhiskerCapLineDashPattern(const QVector< qreal > &pattern)
sets the dash pattern for a custom dash style of whisker cap lines
Qt::PenCapStyle getWhiskerLineCapStyle() const
gets the cap style of whisker lines
void setViolinplotColor(QColor c, QColor bc, JKQTBasePlotter *parent)
set the color of the graph (colors all elements, based on the given color c , sets background colors ...
JKQTPGraphSymbols getMeanSymbolType() const
get the type of the symbol for the mean
QString m_meanSymbolFontName
font to be used for character mean symbols JKQTPCharacterSymbol+QChar('').unicode()
Definition jkqtpviolinplotstylingmixins.h:407
void setMeanLineStyle(Qt::PenStyle __value)
set the line style of Mean lines
QVector< qreal > getMeanLineDashPattern() const
gets the dash pattern for a custom dash style of Mean lines
Qt::PenCapStyle getMedianLineCapStyle() const
gets the cap style of median lines
double m_meanSymbolSize
size (diameter in pt) of the symbol for the data points, given in pt
Definition jkqtpviolinplotstylingmixins.h:399
void setMedianLineWidth(double __value)
set the width [pt] of median lines
Qt::PenStyle getMeanLineStyle() const
get the line style of Mean lines
QPen m_whiskerCapLinePen
line style of the whisker cap lines
Definition jkqtpviolinplotstylingmixins.h:414
void setRelativeWhiskerWidth(double __value)
width of the whiskers, relative to the box width (default: 0.5)
Qt::PenCapStyle getWhiskerCapLineCapStyle() const
gets the cap style of whisker cap lines
double medianLineWidth
line width (in pt) of the median lines
Definition jkqtpviolinplotstylingmixins.h:420
void setWhiskerCapLineCapStyle(Qt::PenCapStyle style)
sets the cap style of whisker cap lines
Qt::PenStyle getWhiskerCapLineStyle() const
get the line style of whisker cap lines
void setMeanSize(double __value)
set the size (=diameter in pt) of the symbol for the mean (in pt)
qreal getWhiskerLineDashOffset() const
returns the dash offset for a custom dash style of whisker lines
QString getMeanSymbolFontName() const
get the font to be used for mean character symbols JKQTPCharacterSymbol+QChar('')....
void plotStyledMeanSymbol(JKQTBasePlotter *parent, JKQTPEnhancedPainter &painter, double x, double y) const
plot a symbol at location x,y (in painter coordinates), using the current style
ViolinStyle m_violinStyle
the style of the violin plot
Definition jkqtpviolinplotstylingmixins.h:430
void setMedianLineDashPattern(const QVector< qreal > &pattern)
sets the dash pattern for a custom dash style of median lines
void setViolinPositionMode(ViolinPositionMode positionMode)
set the position mode of the violin plot
void setWhiskerCapLineBrush(const QBrush &style)
sets the brush used to fill the line area of whisker cap lines
ViolinPositionMode getViolinPositionMode() const
returns the position mode of the violin plot
void plotHorizontalViolinplot(JKQTBasePlotter *parent, JKQTPEnhancedPainter &painter, double yp, double ypbottom, double yptop, const QVector< double > &violin_cat, const QVector< double > &violin_freq, double minp, double medianp, double maxp, double meanp=JKQTP_NAN) const
draws a horizontal boxplot, with all coordinates/sizes given in coordinates of the given painter,...
void setMedianLineBrush(const QBrush &style)
sets the brush used to fill the line area of median lines
double violinWidthAbsolute
width of box in pt.
Definition jkqtpviolinplotstylingmixins.h:425
QPen getWhiskerPen(JKQTPEnhancedPainter &painter, JKQTBasePlotter *parent) const
build a pen to be used for drawing whiskers
void setWhiskerLineStyle(Qt::PenStyle __value)
set the line style of whisker lines
void initViolinplotStyle(JKQTBasePlotter *parent, int &parentPlotStyle)
void setWhiskerCapLineColor(QColor __value)
set the color of whisker cap lines
void setWhiskerLineJoinStyle(Qt::PenJoinStyle style)
sets the join style of whisker lines
void setMedianLineJoinStyle(Qt::PenJoinStyle style)
sets the join style of median lines
#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
#define JKQTP_NAN
double-value NotANumber
Definition jkqtpmathtools.h:87